Skip to content

Commit

Permalink
allow gs1 chaining library to access verification erros
Browse files Browse the repository at this point in the history
Signed-off-by: F-Node-Karlsruhe <[email protected]>
  • Loading branch information
F-Node-Karlsruhe committed Oct 11, 2024
1 parent 27f3515 commit ff80a70
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ VC Verifier Changelog
WIP
---

- allow gs1 chaining library to access verification erros

2.0.3 (2024-07-23)

- fix container startup
Expand Down
10 changes: 8 additions & 2 deletions api/src/services/verifier/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,14 @@ export class Verifier {
if (!result) throw Error("Provided verifiable object is of unknown type!");

// make non enumeratable errors enumeratable for the respsonse
if (result.error && !result.error.errors)
result.error.name = result.error.message;
if (result.error) {
if (!result.error.errors) {
result.error.name = result.error.message;
}
if (result.error.errors) {
result.errors = result.error.errors;
}
}

return result;
}
Expand Down

0 comments on commit ff80a70

Please sign in to comment.