@coko/server
Version:
Reusable server for use by Coko's projects
14 lines (11 loc) • 355 B
JavaScript
const { StatusCodes } = require('http-status-codes')
class NotFoundError extends Error {
constructor(message, status) {
super(message)
Error.captureStackTrace(this, 'NotFoundError')
this.name = 'NotFoundError'
this.message = message || 'Not found'
this.status = status || StatusCodes.NOT_FOUND
}
}
module.exports = NotFoundError