mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2024-12-13 16:06:21 +00:00
e2143b4d80
ClientError will default to 400 HTTP error code. ServerError will default to 500 HTTP error code. Following the previous commit, these for now are only being used in albumsController. More will soon follow. Additionally fixed existing album names can sometimes be re-used when editing an album.
16 lines
254 B
JavaScript
16 lines
254 B
JavaScript
class ClientError extends Error {
|
|
constructor (message, options = {}) {
|
|
super(message)
|
|
|
|
const {
|
|
statusCode
|
|
} = options
|
|
|
|
this.statusCode = statusCode !== undefined
|
|
? statusCode
|
|
: 400
|
|
}
|
|
}
|
|
|
|
module.exports = ClientError
|