Exception: BetterService::Errors::Runtime::AuthorizationError
- Inherits:
-
RuntimeError
- Object
- StandardError
- BetterServiceError
- RuntimeError
- BetterService::Errors::Runtime::AuthorizationError
- Defined in:
- lib/better_service/errors/runtime/authorization_error.rb
Overview
Raised when user is not authorized to perform the action
This error is raised when the authorize_with block returns false. Authorization checks happen before the service execution begins.
Instance Attribute Summary
Attributes inherited from BetterServiceError
#code, #context, #original_error, #timestamp
Instance Method Summary collapse
-
#initialize(message = "Not authorized", code: :unauthorized, context: {}, original_error: nil) ⇒ AuthorizationError
constructor
A new instance of AuthorizationError.
Methods inherited from BetterServiceError
#backtrace, #detailed_message, #inspect, #to_h
Constructor Details
#initialize(message = "Not authorized", code: :unauthorized, context: {}, original_error: nil) ⇒ AuthorizationError
Returns a new instance of AuthorizationError.
35 36 37 |
# File 'lib/better_service/errors/runtime/authorization_error.rb', line 35 def initialize( = "Not authorized", code: :unauthorized, context: {}, original_error: nil) super(, code: code, context: context, original_error: original_error) end |