UNPKG
vanta-api
Version:
latest (1.4.5)
1.4.5
1.4.4
1.4.3
1.4.2
1.4.1
1.4.0
1.3.2
1.3.1
1.3.0
1.2.8
1.2.7
1.2.6
1.2.5
1.2.4
1.2.2
1.2.1
1.2.0
1.1.8
1.1.7
1.1.6
1.1.5
1.1.4
1.1.3
1.1.2
1.1.1
1.1.0
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
Advanced API features and security configuration for Node.js/MongoDB.
vanta-api
/
src
/
handleError.js
10 lines
•
325 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
class
HandleERROR
extends
Error
{
constructor
(message,statusCode){
super
(message)
this
.statusCode=statusCode
this
.status=`${statusCode}`.startsWith(
'4'
)?
'fail'
:
'error'
this
.isOperational=
true
Error.captureStackTrace(
this
,
this
.
constructor
) } } export default HandleERROR