diff --git a/examples/digital-identity/controllers/profile.controller.js b/examples/digital-identity/controllers/profile.controller.js index 6499da37..72488b84 100644 --- a/examples/digital-identity/controllers/profile.controller.js +++ b/examples/digital-identity/controllers/profile.controller.js @@ -263,9 +263,13 @@ module.exports = async (req, res) => { } const receipt = await sdkDigitalIdentityClient.getShareReceipt(receiptId); + const receiptError = receipt.getError(); + const receiptErrorReason = receipt.getErrorReason(); if (receiptError) { - throw new Error(`The receipt was fetched correctly, yet it indicates that an error occurred during the share: ${receiptError}.`); + throw new Error(receiptErrorReason + ? `${receiptError}\nError reason: ${JSON.stringify(receiptErrorReason, null, 2)}` + : `${receiptError}`); } const profile = receipt.getProfile(); diff --git a/examples/idv-identity-checks/views/pages/partials/identity-profile.ejs b/examples/idv-identity-checks/views/pages/partials/identity-profile.ejs index 362fbf76..89f2b85e 100644 --- a/examples/idv-identity-checks/views/pages/partials/identity-profile.ejs +++ b/examples/idv-identity-checks/views/pages/partials/identity-profile.ejs @@ -12,6 +12,26 @@ <%= identityProfile.getResult(); %> + <% if (identityProfile.getFailureReason()) { %> + + Error details: + + + + + + + + + + + + +
Error code<%= identityProfile.getFailureReason().getReasonCode(); %>
Additional details
<%= JSON.stringify(identityProfile.getFailureReason().getRequirementsNotMetDetails(), null, 2); %>
+ + + <% } %> + <% if (identityProfile.getIdentityProfileReport()) { %>> Identity Profile Report @@ -43,5 +63,6 @@ + <% } %>