mirror of
https://github.com/strapi/strapi.git
synced 2025-10-27 08:02:56 +00:00
Add PolicyError error type for use in policies
Signed-off-by: Derrick Mehaffy <derrickmehaffy@gmail.com>
This commit is contained in:
parent
6b2e0dc72d
commit
9fd85b9bfd
@ -69,6 +69,15 @@ class UnauthorizedError extends ApplicationError {
|
||||
}
|
||||
}
|
||||
|
||||
class PolicyError extends ApplicationError {
|
||||
constructor(message, details) {
|
||||
super(message, details);
|
||||
this.name = 'PolicyError';
|
||||
this.message = message || 'Policy Failed';
|
||||
this.details = details || {};
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
HttpError,
|
||||
ApplicationError,
|
||||
@ -79,4 +88,5 @@ module.exports = {
|
||||
ForbiddenError,
|
||||
PayloadTooLargeError,
|
||||
UnauthorizedError,
|
||||
PolicyError,
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user