Skip to content

Commit

Permalink
Merge fa12533 into 835c9b7
Browse files Browse the repository at this point in the history
  • Loading branch information
juneil committed May 14, 2019
2 parents 835c9b7 + fa12533 commit 018895f
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 26 deletions.
47 changes: 28 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hapiness/biim",
"version": "2.0.0",
"version": "2.0.1",
"description": "Error Library to use it inside Hapiness framework or standalone using Boom",
"main": "commonjs/index.js",
"types": "index.d.ts",
Expand Down Expand Up @@ -59,10 +59,9 @@
},
"homepage": "https://github.com/hapinessjs/error#readme",
"dependencies": {
"boom": "^7.3.0"
"@hapi/boom": "^7.4.2"
},
"devDependencies": {
"@types/boom": "^7.2.1",
"@types/fs-extra": "^4.0.5",
"@types/jest": "^24.0.12",
"@types/node": "^8.0.53",
Expand Down
24 changes: 22 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
import * as BiimError from 'boom';
import * as BiimError from '@hapi/boom';

export interface BiimError extends Error {
isBoom: boolean;
isServer: boolean;
message: string;
output: Output;
isMissing?: boolean;
data: any;
reformat(): string;
}
export interface Output {
statusCode: number;
headers: {[index: string]: string};
payload: Payload;
}

export { BiimError };
export interface Payload {
statusCode: number;
error: string;
message: string;
attributes?: any;
}

export class Biim {

Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"skipLibCheck": true,
"typeRoots": ["./node_modules/@types"],
"types": [
"node",
"boom"
"node"
],
"lib": [
"dom",
Expand Down

0 comments on commit 018895f

Please sign in to comment.