@build-tracker/api-errors
Advanced tools
Comparing version 1.0.0-alpha.3 to 1.0.0-alpha.4
"use strict"; | ||
/** | ||
* Copyright (c) 2019 Paul Armstrong | ||
*/ | ||
var __extends = (this && this.__extends) || (function () { | ||
@@ -16,5 +19,13 @@ var extendStatics = function (d, b) { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* Copyright (c) 2019 Paul Armstrong | ||
*/ | ||
var AuthError = /** @class */ (function (_super) { | ||
__extends(AuthError, _super); | ||
function AuthError(message) { | ||
var _this = _super.call(this, "Unauthorized access" + (message ? ": " + message : '')) || this; | ||
_this.status = 401; | ||
Object.setPrototypeOf(_this, AuthError.prototype); | ||
return _this; | ||
} | ||
return AuthError; | ||
}(Error)); | ||
exports.AuthError = AuthError; | ||
var NotFoundError = /** @class */ (function (_super) { | ||
@@ -21,0 +32,0 @@ __extends(NotFoundError, _super); |
{ | ||
"name": "@build-tracker/api-errors", | ||
"version": "1.0.0-alpha.3", | ||
"version": "1.0.0-alpha.4", | ||
"description": "Build Tracker API errors", | ||
@@ -9,2 +9,3 @@ "author": "Paul Armstrong <paul@spaceyak.com>", | ||
"main": "dist", | ||
"module": "./", | ||
"types": "index.ts", | ||
@@ -19,3 +20,3 @@ "scripts": { | ||
}, | ||
"gitHead": "ee6e071ef38eabf07a0f88d27bc6a0c9fce95e73" | ||
"gitHead": "156788a6a199fc25e21adf354c106defd002afbf" | ||
} |
/** | ||
* Copyright (c) 2019 Paul Armstrong | ||
*/ | ||
export class AuthError extends Error { | ||
public readonly status = 401; | ||
public constructor(message?: string) { | ||
super(`Unauthorized access${message ? `: ${message}` : ''}`); | ||
Object.setPrototypeOf(this, AuthError.prototype); | ||
} | ||
} | ||
export class NotFoundError extends Error { | ||
@@ -5,0 +15,0 @@ public readonly status = 404; |
Sorry, the diff of this file is not supported yet
5869
9
103