Should be able to extend errors in a cool way.
import error from 'lvivier/error'
// extending
class BadRequestError extends error.Error {
constructor (msg) {
super(msg)
this.statusCode = 400
}
}
// factory-ing
let BadRequestError = error('BadRequestError', {statusCode:400})