forked from senchalabs/connect
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrorHandler.1
More file actions
58 lines (53 loc) · 1.16 KB
/
errorHandler.1
File metadata and controls
58 lines (53 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
.\" generated with Ronn/v0.6.6
.\" http://github.com/rtomayko/ronn/
.
.TH "ERRORHANDLER" "" "June 2010" "" ""
.
.SH "Error Handler"
The \fIerrorHandler\fR middleware responds to exceptions passed or caught from within middleware above it, according to the options shown below\.
.
.IP "" 4
.
.nf
connect\.createServer(
function(req, res, next){
throw new Error(\'ahhhh!\');
},
connect\.errorHandler({ dumpExceptions: true })
);
.
.fi
.
.IP "" 0
.
.P
By default the response of \fIerrorHandler\fR is 500 \'Internal Server Error\'\. If \fIshowStack\fR is true, then Connect decides how to respond based on the \fIAccept\fR request header:
.
.IP "" 4
.
.nf
text/html Outputs an html version of the stack trace
application/json Outputs json { \'error\': { \'message\': \.\.\. }}
otherwise Outputs plain text stack trace
.
.fi
.
.IP "" 0
.
.SS "Options"
.
.nf
showMessage Show the exception message only
showStack Show the exception message and stack trace
dumpExceptions Output exception stack traces to stderr (does not re\-throw)
.
.fi
.
.SS "Environment Variables"
.
.nf
\-\-showErrorMessage
\-\-showErrorStack
\-\-dumpExceptions
.
.fi