Removing sentry from boilerplate

This commit is contained in:
Unknown committed 2019-03-16 09:39:11 +01:00
1 parent 8ed6fb8d4a
commit 094c2f166f
1 file changed
+4 -30
+4 -30
View File
@@ -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}`
}