1 | /*!
|
2 | * apiai
|
3 | * Copyright(c) 2015 http://api.ai/
|
4 | * Apache 2.0 Licensed
|
5 | */
|
6 |
|
7 | ;
|
8 |
|
9 | var util = require('util');
|
10 |
|
11 | exports.ServerError = module.exports.ServerError = ServerError;
|
12 |
|
13 | util.inherits(ServerError, Error);
|
14 |
|
15 | function ServerError (statusCode, responseBody, message) {
|
16 | var self = this;
|
17 |
|
18 | Error.captureStackTrace(this, ServerError);
|
19 |
|
20 | self.statusCode = statusCode;
|
21 | self.responseBody = responseBody;
|
22 |
|
23 | this.name = this.constructor.name;
|
24 | this.message = message;
|
25 |
|
26 | ServerError.super_.apply(this, []);
|
27 | }
|