Skip to content

Commit b5f5f55

Browse files
committed
error handling
1 parent fe399bd commit b5f5f55

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

lib/click/controllers/eg006EmbedClickwrap.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
const eg = `eg00${exampleNumber}`; // This example reference.
1717
const mustAuthenticate = "/ds/mustAuthenticate";
1818
const minimumBufferMin = 3;
19-
//const demoDocumentsPath = path.resolve(__dirname, "../../../demo_documents");
2019

2120
/**
2221
* Create clickwrap
@@ -53,7 +52,6 @@
5352
accountId: req.session.accountId,
5453
clickwrapName: req.body.clickwrapName,
5554
clickwrapId: req.body.clickwrapId,
56-
//docFile: path.resolve(demoDocumentsPath, dsConfig.docTermsPdf),
5755
documentArgs: documentArgs
5856
};
5957

@@ -69,7 +67,7 @@
6967
const errorMessage = errorBody && errorBody.message;
7068
// In production, you may want to provide customized error messages and
7169
// remediation advice to the user
72-
res.render("pages/error", { err: error, errorCode, errorMessage });
70+
res.render("pages/error_eg006", { err: error, errorCode, errorMessage });
7371
}
7472
if (results) {
7573
// Save for use by other examples that need an clickwrapId

views/pages/error_eg006.ejs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<% title = "Error" %>
2+
<%- include("../partials/genericHead") %>
3+
4+
<h2>Problem: an error occurred</h2>
5+
<p>Error information:</p>
6+
7+
<% if (errorCode) { %>
8+
<p><%= errorCode %>: <%= errorMessage %></p>
9+
<p><%- errorInfo %></p>
10+
<% } else { %>
11+
<p><pre><%= err %></pre></p>
12+
<p>The email address was already used to agree to this elastic template. Provide a different email address if you want to view the agreement and agree to it.</p>
13+
<h3>Stack trace</h3>
14+
<p><pre>
15+
<%= err.stack %>
16+
</pre></p>
17+
<% } %>
18+
19+
20+
<p><a href="/">Continue</a></p>
21+
22+
<%- include("../partials/genericFoot") %>

0 commit comments

Comments
 (0)