mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 23:27:26 +01:00
tweaks eslint rules, fixes gulp-eslint, adds some comments
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user