mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 23:27:26 +01:00
add basic .eslintrc and correct some style issues
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user