Skip to content

Commit

Permalink
fix: corrected how nionic errors are caught and passed through (#336)
Browse files Browse the repository at this point in the history
* fix: corrected how nionic errors are caught and passed through

* fix: stringify errors list as error message for nionic module
  • Loading branch information
gwinchesters authored Sep 13, 2023
1 parent 7a41527 commit 327f1ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/nionic/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class Nionic {
const tenantId = this._getTenantId(orgOrTenantId);
const url = `${this._baseUrl.replace('<tenant>', tenantId)}/graphql`;
return this._request.post(url, options).then((resp) => {
if (resp.data && resp.data.errors) {
return Promise.reject(Error(resp.data.errors));
if (resp.errors) {
return Promise.reject(Error(JSON.stringify(resp.errors)));
}
return Promise.resolve(resp.data);
});
Expand Down

0 comments on commit 327f1ef

Please sign in to comment.