OpenAPITools / OpenAPITools/openapi-generator

[REQ][Perl] Improve error/exception handling

Open
#17,691 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Is your feature request related to a problem? Please describe.

I think error handling could be significantly improved, compared to the current usage of Carp. As well, there are some unimplemented error logic in ApiClient.mustache that should be addressed.

  1. Since Moo/Moose is supported, something like Throwable::Factory might fit nicely.
  2. If Moo/Moose is not preferred, Exception::Class would be another option.
  3. If Exception::Class is not preferred, a simple Error class similar to Carton::Error
  4. Finally, if you have a preference to return error objects instead of throwing exceptions, I believe I can make that work as well.

Describe the solution you'd like

I am fairly open to implementation, but my preference is listed in order above.

Describe alternatives you've considered

Additional context

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Perl ApiClient.mustache template and inspect its current Carp usage and unimplemented error logic. Review the proposed exception and error-object alternatives, then define and implement a consistent strategy with coverage for the affected generated client behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
perl
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.