Commit 5dc0bce9 authored by Nicolai Mainiero's avatar Nicolai Mainiero
Browse files

Improved Error types to work in browsers without v8 engine

parent df58203b
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -7,7 +7,11 @@ function RequestError(cause) {
    this.message = String(cause);
    this.cause = cause;

    if(Error.captureStackTrace){
      Error.captureStackTrace(this);
    } else {
      Error.call(this);
    }

}
RequestError.prototype = Object.create(Error.prototype);
@@ -20,7 +24,11 @@ function StatusCodeError(statusCode, message) {
    this.statusCode = statusCode;
    this.message = statusCode + ' - ' + message;

    if(Error.captureStackTrace){
      Error.captureStackTrace(this);
    } else {
      Error.call(this);
    }

}
StatusCodeError.prototype = Object.create(Error.prototype);