swagger-api / swagger-api/swagger-codegen

[Python] No way to handle exceptions in asyncronous code (with callback)

Open
#4,235 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Client: Python help wanted Issue: Bug
Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

Produced by codegen Python code does not support handling of exceptions in anync mode (with callback).
If swagger client code raises exeption, callback will never be called.

Swagger-codegen version

5

Command line used for generation

-l python

Suggest a Fix

Catch all exceptions in generated swagger client and return special type of result in case of exceptions.

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 Python client generation entry point used by -l python, focusing on asynchronous callback code. Reproduce an exception in generated async code and verify that the callback is invoked with a defined exception result instead of never being called.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.