From 248123763166949c309bd8bfb61595c70e4138db Mon Sep 17 00:00:00 2001 From: Matias Date: Thu, 4 Jul 2019 19:11:58 -0300 Subject: [PATCH 1/2] Removing unused error definitions --- src/errors/index.js | 40 ++++++++++++++++------------------------ 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/src/errors/index.js b/src/errors/index.js index b6c507c56..e9999e0a1 100644 --- a/src/errors/index.js +++ b/src/errors/index.js @@ -1,31 +1,23 @@ -class ClientError extends Error { - constructor(args) { - super(args); +export class AuthenticationError extends Error { + constructor(message) { + super(message) + this.code = 401 + this.message = 'Autentification not found, you have to be authentificated to perform this action.' } } -class ServerError extends Error { - constructor(args) { - super(args); +export class WrongArgumentsError extends Error { + constructor(message) { + super(message) + this.code = 400 + this.message = `Wrong arguments : ${this.message}` } } -export class AuthenticationError extends ClientError { - // code = 401 - // message = 'Authentication not found, you have to be authenticated to perform this action' -} - -export class DatabaseError extends ClientError { - // code = 404 - // message = `Ressource not found : ${this.message}` -} - -export class WrongArgumentsError extends ClientError { - // code = 400 - // message = `Wrong arguments : ${this.message}` -} - -export class ServiceUnavailableError extends ServerError { - // code = 503 - // message = `At least one service is unresponding ${this.message}` +export class ServiceUnavailableError extends Error { + constructor(message) { + super(message) + this.code = 503 + this.message = `At least one service is unresponding ${this.message}` + } } From 2b7f4eaed4a1cc7ae2453a3a02df8d7bcbc60d5e Mon Sep 17 00:00:00 2001 From: Matias Date: Thu, 4 Jul 2019 19:12:24 -0300 Subject: [PATCH 2/2] Removing not null to fin on create issue --- src/schema/types/input/Bot.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/schema/types/input/Bot.js b/src/schema/types/input/Bot.js index b71172621..1fdcd09ad 100644 --- a/src/schema/types/input/Bot.js +++ b/src/schema/types/input/Bot.js @@ -8,9 +8,9 @@ const Type = new GraphQLInputObjectType({ name: 'BotInput', description: 'Payload for bot input.', fields: () => ({ - devTeam: { type: new GraphQLNonNull(GraphQLString) }, codeName: { type: new GraphQLNonNull(GraphQLString) }, - productCodeName: { type: new GraphQLNonNull(GraphQLString) }, + productCodeName: { type: GraphQLString }, + devTeam: { type: GraphQLString}, displayName: { type: GraphQLString }, repo: { type: GraphQLString }, configFile: { type: GraphQLString },