Skip to content
This repository has been archived by the owner on Mar 29, 2023. It is now read-only.

Commit

Permalink
serialize child errors in error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Julli4n committed Mar 31, 2022
1 parent 7ac0ac9 commit 1c4875b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/rest/RESTController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ export class RESTController {
: parseBEDEV2Error)(response);
const errorsToString = errors.map((error) => {
return Object.entries(error).map(([key, value]) =>
`${key}: "${value}"`
`${key}: "${Array.isArray(value) ? JSONv2.serialize(value) : value}"`
).join(", ");
}).join("\n");

Expand Down
4 changes: 2 additions & 2 deletions src/utils/parseBEDEV2Error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ export async function parseBEDEV2Error(
childErrors: "errorDetails" in json
? json.errorDetails.map((error) => {
return {
type: error.datastoreErrorCode,
code: error.errorDetailType,
type: error.errorDetailType,
code: error.datastoreErrorCode
};
})
: [],
Expand Down

0 comments on commit 1c4875b

Please sign in to comment.