From 094c2f166fbc3b217217a2695f8bdadec3ff95f0 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 16 Mar 2019 09:39:11 +0100 Subject: [PATCH] Removing sentry from boilerplate --- src/errors/index.js | 34 ++++------------------------------ 1 file changed, 4 insertions(+), 30 deletions(-) diff --git a/src/errors/index.js b/src/errors/index.js index 16c3974f1..3cf8868b4 100644 --- a/src/errors/index.js +++ b/src/errors/index.js @@ -1,45 +1,19 @@ -import * as Sentry from '@sentry/node'; - -class ClientError extends Error { - constructor(args) { - super(args); - Sentry.configureScope((scope) => { - scope.setLevel('debug'); - }); - Sentry.captureException(this); - } -} - -class ServerError extends Error { - constructor(args) { - super(args); - Sentry.configureScope((scope) => { - scope.setLevel('error'); - }); - Sentry.captureException(this); - } -} - -export class AuthentificationError extends ClientError { +export class AuthentificationError extends Error { code = 401 - message = 'Autentification not found, you have to be authentificated to perform this action' } -export class DatabaseError extends ClientError { +export class DatabaseError extends Error { code = 404 - message = `Ressource not found : ${this.message}` } -export class WrongArgumentsError extends ClientError { +export class WrongArgumentsError extends Error { code = 400 - message = `Wrong arguments : ${this.message}` } -export class ServiceUnavailableError extends ServerError { +export class ServiceUnavailableError extends Error { code = 503 - message = `At least one service is unresponding ${this.message}` }