Skip to content

Commit

Permalink
Merge pull request #51 from qorelanguage/bugfix/empty-response-fix
Browse files Browse the repository at this point in the history
Bump version to 0.4.11 and enhance QorusRequest to handle 204 and 404 status codes by returning an empty object
  • Loading branch information
Foxhoundn authored Dec 10, 2024
2 parents f5bb264 + ebeb0e9 commit dffb668
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@qoretechnologies/ts-toolkit",
"version": "0.4.10",
"version": "0.4.11",
"description": "Utility library to interact with Qorus Integration Engine & Qore Language",
"keywords": [
"qoretechnologies",
Expand Down
4 changes: 4 additions & 0 deletions src/QorusRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ export class QorusRequest {
throw new ErrorQorusRequest(text);
}

if (promise.status === 204 || promise.status === 404) {
return { data: {} };
}

let json: any;

// We need to turn the promise to json but if the response is empty we need to return an empty object
Expand Down

0 comments on commit dffb668

Please sign in to comment.