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}` + } } 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 },