Skip to content

Commit

Permalink
Errors check fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ackava committed May 8, 2024
1 parent a19f92c commit 78a6a6e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/services/http/JsonError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ export default class JsonError extends Error {
}

public get details() {
if (this.json.paramErrors) {
return this.errors.map((x) => `${x.name}: ${x.reason}`).join("\n");
const { errors } = this;
if (errors.length) {
return errors.map((x) => `${x.name}: ${x.reason}`).join("\n");
}
return this.json?.details;
}
Expand Down

0 comments on commit 78a6a6e

Please sign in to comment.