Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fega01/app-error

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fega01/app-error - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

7

dist/index.d.ts

@@ -20,1 +20,8 @@ export interface AppErrorObject {

}
/**
* Common Errors
*/
export declare const BAD_REQUEST: AppErrorObject;
export declare const NOT_FOUND: AppErrorObject;
export declare const UNAUTHORIZED: AppErrorObject;
export declare const FORBIDDEN: AppErrorObject;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const http_status_1 = require("http-status");
/**

@@ -20,2 +21,25 @@ * Example of error

exports.AppError = AppError;
/**
* Common Errors
*/
exports.BAD_REQUEST = {
code: "BAD_REQUEST",
status: http_status_1.BAD_REQUEST,
message: "bad request"
};
exports.NOT_FOUND = {
code: "NOT_FOUND",
status: http_status_1.NOT_FOUND,
message: "Resource not found"
};
exports.UNAUTHORIZED = {
code: "UNAUTHORIZED",
status: http_status_1.UNAUTHORIZED,
message: "Unauthorized"
};
exports.FORBIDDEN = {
code: "FORBIDDEN",
status: http_status_1.FORBIDDEN,
message: "Access Denied"
};
//# sourceMappingURL=index.js.map

8

package.json
{
"name": "@fega01/app-error",
"version": "1.0.0",
"version": "1.1.0",
"description": "A nice controller based on Proxies",

@@ -42,3 +42,5 @@ "main": "dist/index.js",

},
"dependencies": {},
"dependencies": {
"http-status": "^1.1.2"
},
"nyc": {

@@ -59,2 +61,2 @@ "extension": [

"types": "./dist/index.d.ts"
}
}

@@ -0,2 +1,4 @@

import { BAD_REQUEST as BR, NOT_FOUND as NF, UNAUTHORIZED as UNA, FORBIDDEN as F } from "http-status";
export interface AppErrorObject {

@@ -27,2 +29,27 @@ code: string;

}
}
}
/**
* Common Errors
*/
export const BAD_REQUEST: AppErrorObject = {
code: "BAD_REQUEST",
status: BR,
message: "bad request"
};
export const NOT_FOUND: AppErrorObject = {
code: "NOT_FOUND",
status: NF,
message: "Resource not found"
};
export const UNAUTHORIZED: AppErrorObject = {
code: "UNAUTHORIZED",
status: UNA,
message: "Unauthorized"
};
export const FORBIDDEN: AppErrorObject = {
code: "FORBIDDEN",
status: F,
message: "Access Denied"
};

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc