-
Notifications
You must be signed in to change notification settings - Fork 16
/
http_errors.node.txt
29 lines (21 loc) · 2.02 KB
/
http_errors.node.txt
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
HTTP-ERRORS
ALTERNATIVES ==> # - http-errors (preferred with Node)
# - deno http_errors (preferred with Deno)
VERSION ==> #2.0.0
#ERROR type specific for HTTP status codes
#Package called http-errors
HTTPERRORS.HttpError #Constructor. Inherits from ERROR
HTTPERRORS.STATUS_NUM #Constructor for specific status. Child of HTTPERROR
HTTPERRORS.STATUS_STR #Same, with STATUS_STR titleized, e.g. NotFound
HTTPERRORS
([STATUS_NUM[,'MESSG'][,OBJ]])
->HTTPERROR #OBJ is merged in HTTPERROR
HTTPERROR.name #'STATUSError', only for 4**|5**
HTTPERROR.message #'MESSAGE' (def: 'STATUS')
HTTPERROR.status[Code] #STATUS_NUM (def: 500)
HTTPERROR.expose #Hint that it should be hidden from client
#False for 5**, true otherwise
HTTPERRORS.isHttpError(VAL)
->BOOL #