Exception: Operandi::RuntimeError
- Defined in:
- lib/operandi/exceptions.rb
Overview
Raised for failures that occur while a service instance is running.
Instance Attribute Summary collapse
-
#service ⇒ Base
readonly
The service instance that raised the error.
Instance Method Summary collapse
-
#initialize(message = nil, service:) ⇒ RuntimeError
constructor
A new instance of RuntimeError.
Constructor Details
#initialize(message = nil, service:) ⇒ RuntimeError
Returns a new instance of RuntimeError.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/operandi/exceptions.rb', line 14 def initialize( = nil, service:) raise ArgumentError, "service is required" unless service unless defined?(Operandi::Base) && service.is_a?(Operandi::Base) raise ArgumentError, "service must be an Operandi::Base instance" end @service = service super() end |
Instance Attribute Details
#service ⇒ Base (readonly)
Returns the service instance that raised the error.
10 11 12 |
# File 'lib/operandi/exceptions.rb', line 10 def service @service end |