Skip to content

newErrorHandling suppresses any error codes #277

Closed
@skrud-dt

Description

@skrud-dt

Under documentation, we're told to set newErrorHandling: true: https://github.com/MrRefactoring/jira.js#deprecation-warnings

However, this strips out all metadata from the axios error including the status, statusText, and code. I know axios errors include lots of extra information that could cause leaks (like headers, etc.) - but without the status and code fields, it's impossible to know what actually went wrong.

The data field in the Axios Response is maintained, but from JIRA this contains an array of localized strings. Which is impossible to compare against.

Specifically, let's say I try to look up an issue that doesn't exist or that I don't have permission to see.

Using newErrorHandling, this gives me back an object like this:

{
    errorMessages: [
       "Issue does not exist or you do not have permission to see it."
    ]
}

And there is nothing else in the object. This isn't useful to me.

Furthermore, there doesn't seem to be a workaround, because the client's onError middleware receives the transformed error (e.g. the one with all the fields stripped out), not the raw Axios error.

Metadata

Metadata

Assignees

Labels

enhancementDenotes a suggestion or request aimed at improving or adding new features to the project.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions