We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1c1ec84 commit 337c0abCopy full SHA for 337c0ab
lib/index.js
@@ -5,14 +5,25 @@ const ErrorHandler = require('./error-handler')
5
async function register (server, options) {
6
const { showErrors = false, template, ...config } = options
7
8
+ /**
9
+ * Cut early and don’t register extension point,
10
+ * e.g. when in production.
11
+ */
12
if (!showErrors) {
13
return
14
}
15
16
17
+ * Ensure the user server is able to render
18
+ * templates when going for a custom one.
19
20
if (template) {
21
server.dependency(['vision'])
22
23
24
25
+ * Alright, go for gold!
26
27
const errorHandler = new ErrorHandler({ template, ...config })
28
29
server.ext('onPreResponse', async (request, h) => {
0 commit comments