Exception: Bonita::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Bonita::Error
- Defined in:
- lib/bonita/error.rb
Instance Attribute Summary collapse
-
#error_message ⇒ Object
readonly
Returns the value of attribute error_message.
-
#explanations ⇒ Object
readonly
Returns the value of attribute explanations.
-
#java_exception ⇒ Object
readonly
Returns the value of attribute java_exception.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(status, body) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(status, body) ⇒ Error
Returns a new instance of Error.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/bonita/error.rb', line 6 def initialize(status, body) if body['exception'] mapping = Bonita::ErrorMapping.extract_single(body, :read) @java_exception = mapping.exception @error_message = mapping. @explanations = mapping.explanations @status = status values = Hash[instance_variables.map { |name| [name, instance_variable_get(name)] }] else values = body end super(values) end |
Instance Attribute Details
#error_message ⇒ Object (readonly)
Returns the value of attribute error_message.
4 5 6 |
# File 'lib/bonita/error.rb', line 4 def @error_message end |
#explanations ⇒ Object (readonly)
Returns the value of attribute explanations.
4 5 6 |
# File 'lib/bonita/error.rb', line 4 def explanations @explanations end |
#java_exception ⇒ Object (readonly)
Returns the value of attribute java_exception.
4 5 6 |
# File 'lib/bonita/error.rb', line 4 def java_exception @java_exception end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/bonita/error.rb', line 4 def status @status end |