resolving merge conflicts removed this file for some reason

pull/34/head
unknown 2018-11-19 19:01:54 -05:00
parent e8af8f156b
commit f40c1c34b9
1 changed files with 16 additions and 0 deletions

16
api/errors/HttpError.js Normal file
View File

@ -0,0 +1,16 @@
class HttpError extends Error {
constructor (status, message, hint) {
super(message)
if (typeof status !== 'number') throw new Error('HttpError status must be an integer')
this.status = status
this.hint = hint || 'none'
}
send (res) {
return res.status(this.status).json({
error: this.message,
hint: this.hint
})
}
}
module.exports = HttpError