Skip to content

[BUG] Response body is missing from custom exception message #22351

@ddl-rliu

Description

@ddl-rliu

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

When using the API client and encountering an exception, the user sees

E           ...exceptions.ServiceException: (500)
E           Reason: Internal Server Error
E           HTTP response headers: HTTPHeaderDict(...)
E           HTTP response body: error=None

This is unfortunate, as the useful response body of the exception is "overriden" by the not-useful response data "error=None"

openapi-generator version

7.14.0

OpenAPI declaration file content or url
Generation Details
Steps to reproduce

Create a call against a client which produces e.g. a 500 error, with an http response containing response data, and a useful response body. The useful response body will be missing from the exception str.

Related issues/PRs

#22352

Suggest a fix

master...ddl-rliu:openapi-generator:patch-1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions