Class: Glia::Errors::Error
- Inherits:
-
Object
- Object
- Glia::Errors::Error
- Defined in:
- lib/glia/errors/error.rb
Overview
Base error
Direct Known Subclasses
InputValidationError, InvalidFormatError, InvalidLengthError, InvalidNumberError, InvalidResourceStateError, InvalidTypeError, InvalidValueError, LimitExceededError, MissingValueError, NotVerifiedError, RemainingAssociationError, ResourceAlreadyExistsError, ResourceNotFoundError, UnknownError
Instance Attribute Summary collapse
-
#error_details ⇒ Object
readonly
Returns the value of attribute error_details.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#ref ⇒ Object
readonly
Returns the value of attribute ref.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type:, ref:, message: nil, error_details: nil) ⇒ Error
constructor
A new instance of Error.
- #to_h ⇒ Object
Constructor Details
#initialize(type:, ref:, message: nil, error_details: nil) ⇒ Error
9 10 11 12 13 14 |
# File 'lib/glia/errors/error.rb', line 9 def initialize(type:, ref:, message: nil, error_details: nil) @type = type @ref = ref = @error_details = error_details end |
Instance Attribute Details
#error_details ⇒ Object (readonly)
Returns the value of attribute error_details.
7 8 9 |
# File 'lib/glia/errors/error.rb', line 7 def error_details @error_details end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
7 8 9 |
# File 'lib/glia/errors/error.rb', line 7 def end |
#ref ⇒ Object (readonly)
Returns the value of attribute ref.
7 8 9 |
# File 'lib/glia/errors/error.rb', line 7 def ref @ref end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
7 8 9 |
# File 'lib/glia/errors/error.rb', line 7 def type @type end |
Instance Method Details
#to_h ⇒ Object
16 17 18 19 20 |
# File 'lib/glia/errors/error.rb', line 16 def to_h { type: type, ref: ref, message: , error_details: error_details_to_h(@error_details) }.compact end |