Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #4296
Closed
Open
Issue created Oct 28, 2019 by Administrator@rootContributor

[BUG][JavaScript]Timeout unhandled causes crash after PR #1814

Created by: fabik111

Description

With PR #1814 was added in the callApi function an object err to better handle errors. err has four attributes taken from the response obj>

 request.end((error, response) => {
                if (error) {
                    var err = {};
                    err.status = response.status;
                    err.statusText = response.statusText;
                    err.body = response.body;
                    err.response = response;
                    err.error = error;

                    reject(err);

If the call ends with a timeout error, the response obj will be undefined and so I've this problem: TypeError: Cannot read property 'status' of undefined

openapi-generator version

v4.1.3

Related issues/PRs

PR #1814 Line code with bug

Suggest a fix/enhancement

Add a check if response is undefined

Assignee
Assign to
Time tracking