Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Commit

Permalink
Pass correct ApiException in case of asyncronous jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanoverna committed May 29, 2020
1 parent 8b4e47e commit d469548
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "datocms-client",
"version": "3.0.24",
"version": "3.0.25",
"description": "DatoCMS API client and CLI tool",
"browser": "dist/client.js",
"main": "lib/index.js",
Expand Down
5 changes: 4 additions & 1 deletion src/utils/generateClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ export default function generateClient(subdomain, cache, extraMethods = {}) {
jobResult.attributes.status >= 300
) {
throw new ApiException(
jobResult,
{
status: jobResult.attributes.status,
statusText: jobResult.attributes.statusText,
},
jobResult.attributes.payload,
);
}
Expand Down

0 comments on commit d469548

Please sign in to comment.