Skip to content

Commit

Permalink
SDK-2352: Add share error reason to example module
Browse files Browse the repository at this point in the history
  • Loading branch information
irotech committed Oct 26, 2023
1 parent 6a17c6a commit 67e12c1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ public String receipt(@RequestParam("receiptId") String receiptId, Model model)

if (receipt == null || receipt.getError().isPresent()) {
model.addAttribute("error", receipt.getError().get());

receipt.getErrorReason()
.ifPresent(reason -> model.addAttribute("errorReason", reason));

return "error";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public IdentitySessionController(DigitalIdentityClient client) {
public String identityShareSession() {
ShareSession session = client.createShareSession(
// forMinimalShare()
forDynamicScenarioShare()
// forIdentityProfileShare()
// forDynamicScenarioShare()
forIdentityProfileShare()
// forLocationExtensionShare()
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,19 @@
<div class="box">
<h2><a href="/v2/digital-identity-share">Home</a></h2>
<h3>Oops, something went wrong.</h3>
<h3>Error: <span th:text="${error}"/></h3>
<h3>Error:</h3>
<span th:text="${error}"/>
<div th:if="${errorReason}">
<h3>Reason:</h3>
<pre id="error-reason-json" style="white-space: pre-wrap;"></pre>
</div>
</div>
</section>
</main>
</body>

<script th:inline="javascript">
document.getElementById("error-reason-json").textContent = JSON.stringify(/*[(${errorReason})]*/ '', null, 2);
</script>

</html>

0 comments on commit 67e12c1

Please sign in to comment.