From ff80a70c3012baf3dd53e881bc03db210c200db7 Mon Sep 17 00:00:00 2001 From: F-Node-Karlsruhe Date: Fri, 11 Oct 2024 13:41:56 +0200 Subject: [PATCH] allow gs1 chaining library to access verification erros Signed-off-by: F-Node-Karlsruhe --- CHANGELOG.md | 2 ++ api/src/services/verifier/index.ts | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a278c06..d9c4717 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/api/src/services/verifier/index.ts b/api/src/services/verifier/index.ts index 023fe2e..cf36609 100644 --- a/api/src/services/verifier/index.ts +++ b/api/src/services/verifier/index.ts @@ -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; }