This commit is contained in:
ryanwong
2022-02-06 22:15:10 -05:00
parent 46625dd6cd
commit a07577bffa
145 changed files with 12008 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
const { AuthenticationError: AuthenticationErrorNative } = require('apollo-server-express');
const { GraphQLError } = require('graphql');
class ErrorService extends Error {
constructor(name = null, message = null, code = null) {
super();
this.name = name;
this.message = message;
this.code = code;
this.stack = null;
}
}
class GraphqlErrorService extends GraphQLError {
constructor(message = '', code) {
super(message);
this.message = message;
this.code = code;
this.stack = null;
}
}
class AuthenticationError extends AuthenticationErrorNative {
constructor(message = null, code = null) {
super(message);
this.extensions.code = code;
this.code = code;
this.stack = null;
}
}
module.exports = {
Error: ErrorService,
GraphqlError: GraphqlErrorService,
AuthenticationError,
};