add basic .eslintrc and correct some style issues

This commit is contained in:
Matteo Pagliazzi
2015-11-03 13:55:54 +01:00
parent 7b4d082ab8
commit 5f3e798016
2 changed files with 22 additions and 7 deletions

View File

@@ -7,7 +7,7 @@ class CustomError extends Error {
super();
Error.captureStackTrace(this, this.constructor);
}
};
}
// NotAuthorized error with a 401 http error code
// used when a request is not authorized
@@ -16,9 +16,9 @@ class NotAuthorized extends CustomError {
super();
this.name = this.constructor.name;
this.httpCode = 401;
this.message = customMessage || 'Not authorized.'
this.message = customMessage || 'Not authorized.';
}
};
}
// BadRequest error with a 400 http error code
// used for requests not formatted correctly
@@ -28,9 +28,9 @@ class BadRequest extends CustomError {
super();
this.name = this.constructor.name;
this.httpCode = 400;
this.message = customMessage || 'Bad request.'
this.message = customMessage || 'Bad request.';
}
};
}
// InternalError error with a 500 http error code
// used when an unexpected, internal server error is thrown
@@ -39,9 +39,9 @@ class InternalServerError extends CustomError {
super();
this.name = this.constructor.name;
this.httpCode = 500;
this.message = customMessage || 'Internal server error.'
this.message = customMessage || 'Internal server error.';
}
};
}
module.exports = {
CustomError,