Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | 1x 146x 92x 54x 146x 1x | import {RestError} from './rest-error';
/**
* Error if the user isn't authorized for the resources he/she requested.
*
* Or if the send token is not valid.
*/
class UnauthorizedError extends RestError {
/**
* Creates an instance of this class.
* @param message - The message of the error.
* If none is provided the following default message is used:
* `You're not authorized to access the resource`
*/
constructor(message?: string) {
let _message;
if (message !== undefined) {
_message = message;
} else {
_message = 'You\'re not authorized to access the resource';
}
super(401, _message);
}
}
export default UnauthorizedError;
|