Skip to content

Commit

Permalink
fix: error handling for HTTP status 422
Browse files Browse the repository at this point in the history
Added error handling for HTTP status 422 in API responses, returning a descriptive QaseError with relevant details.
  • Loading branch information
gibiw committed Nov 26, 2024
1 parent 65450e1 commit 42890bd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions qase-javascript-commons/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# [email protected]

## What's new

Added error handling for HTTP status 422 in API responses, returning a descriptive QaseError with relevant details.

# [email protected]

## What's new
Expand Down
2 changes: 1 addition & 1 deletion qase-javascript-commons/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "qase-javascript-commons",
"version": "2.2.5",
"version": "2.2.6",
"description": "Qase JS Reporters",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion qase-javascript-commons/src/reporters/testops-reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ export class TestOpsReporter extends AbstractReporter {
return new QaseError(message + ': Not found.');
}

if (error.response?.status === 400) {
if (error.response?.status === 400 || error.response?.status === 422) {
return new QaseError(message + ': Bad request. Body: \n ' + JSON.stringify(model));
}

Expand Down

0 comments on commit 42890bd

Please sign in to comment.