tweaks eslint rules, fixes gulp-eslint, adds some comments

This commit is contained in:
Matteo Pagliazzi
2015-11-04 18:50:08 +01:00
parent 235f1977ba
commit 3135613be3
7 changed files with 19 additions and 15 deletions

View File

@@ -3,7 +3,7 @@
// Base class for custom application errors
// It extends Error and capture the stack trace
class CustomError extends Error {
constructor() {
constructor () {
super();
Error.captureStackTrace(this, this.constructor);
}
@@ -12,7 +12,7 @@ class CustomError extends Error {
// NotAuthorized error with a 401 http error code
// used when a request is not authorized
class NotAuthorized extends CustomError {
constructor(customMessage) {
constructor (customMessage) {
super();
this.name = this.constructor.name;
this.httpCode = 401;
@@ -24,7 +24,7 @@ class NotAuthorized extends CustomError {
// used for requests not formatted correctly
// TODO use for validation errors too?
class BadRequest extends CustomError {
constructor(customMessage) {
constructor (customMessage) {
super();
this.name = this.constructor.name;
this.httpCode = 400;
@@ -35,7 +35,7 @@ class BadRequest extends CustomError {
// InternalError error with a 500 http error code
// used when an unexpected, internal server error is thrown
class InternalServerError extends CustomError {
constructor(customMessage) {
constructor (customMessage) {
super();
this.name = this.constructor.name;
this.httpCode = 500;