mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2024-12-15 00:46:22 +00:00
19 lines
309 B
JavaScript
19 lines
309 B
JavaScript
|
class ServerError extends Error {
|
||
|
constructor (message, options = {}) {
|
||
|
super(message)
|
||
|
|
||
|
const {
|
||
|
statusCode,
|
||
|
logStack
|
||
|
} = options
|
||
|
|
||
|
this.statusCode = statusCode !== undefined
|
||
|
? statusCode
|
||
|
: 500
|
||
|
|
||
|
this.logStack = logStack || false
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module.exports = ServerError
|