Class

AuthorizationError

AuthorizationError(msg)

Constructor

# new AuthorizationError(msg)

This error is thrown when a user attempts to access a resource or perform an action without proper authentication

Error thrown when a user is not authorized to perform an action

Parameters:
Name Type Description
msg string | Error

The error message or Error object

View Source utils/errors.ts, line 3

Example
```typescript
// Example of throwing an AuthorizationError
if (!user.isAuthenticated()) {
  throw new AuthorizationError('User not authenticated');
}
```