mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
add tests, move CustomError to common, fix casting
This commit is contained in:
9
common/script/api-v3/errors.js
Normal file
9
common/script/api-v3/errors.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import CustomError from './customError';
|
||||
|
||||
export class NotAuthorized extends CustomError {
|
||||
constructor (customMessage) {
|
||||
super();
|
||||
this.name = this.constructor.name;
|
||||
this.message = customMessage || 'Not authorized.';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user