Skip to content

Commit

Permalink
define error types
Browse files Browse the repository at this point in the history
  • Loading branch information
iyobo committed May 25, 2023
1 parent 0a7bb28 commit b24a63b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/util/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ export const boom = require('@hapi/boom');


// 400s
export const errorBadRequest = boom.badRequest;
export const errorBadRequest: typeof boom.badRequest = boom.badRequest;

export const errorNotLoggedIn = boom.unauthorized;
export const errorNotLoggedIn: typeof boom.unauthorized = boom.unauthorized;

export const errorForbidden = boom.forbidden;
export const errorForbidden: typeof boom.forbidden = boom.forbidden;

export const errorNotFound = boom.notFound;
export const errorNotFound: typeof boom.notFound = boom.notFound;

export const errorBadInput = boom.badData;
export const errorBadInput: typeof boom.badData = boom.badData;

// 500s
export const errorInternal = boom.internal;
export const errorInternal: typeof boom.internal = boom.internal;

export const errorDependencyFailed = boom.failedDependency;
export const errorDependencyFailed: typeof boom.failedDependency = boom.failedDependency;


0 comments on commit b24a63b

Please sign in to comment.