1 | const AliImgError = function (message, code) {
|
2 | this.message = message
|
3 | this.code = code || -1
|
4 | this.name = 'AliImgError'
|
5 | Error.captureStackTrace(this, AliImgError)
|
6 | }
|
7 | AliImgError.prototype = Object.create(Error.prototype)
|
8 |
|
9 | const HTTPError = function (statusCode, message) {
|
10 | this.statusCode = statusCode
|
11 | this.message = message || ''
|
12 | this.name = 'HTTPError'
|
13 | Error.captureStackTrace(this, HTTPError)
|
14 | }
|
15 | HTTPError.prototype = Object.create(Error.prototype)
|
16 |
|
17 | module.exports = {AliImgError, HTTPError} |
\ | No newline at end of file |