Skip to content

[BUG][PHP] operationAsyncWithHttpInfo incorrectly handles ConnectException (operationWithHttpInfo does this correct) #23454

@bkonetzny

Description

@bkonetzny

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

Calling *AsyncWithHttpInfo breaks if a ConnectException is thrown, as this doesn't provide the getResponse method which is used in exception handling. *WithHttpInfo does this correctly and has a dedicated catch-branch for this.

openapi-generator version

docker image latest, branch master, e.g. now v7.21.0

OpenAPI declaration file content or url

not related to a specific declaration, applies to all due to the error handling

Generation Details

does not apply

Steps to reproduce

does not apply

Related issues/PRs

#23455

Suggest a fix

Exception handling breaks for the Exception being of type ConnectException in https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/php/api.mustache#L485, needs same logic as https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/php/api.mustache#L485

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