Class: Glia::Errors::Error
- Inherits:
-
Object
- Object
- Glia::Errors::Error
- Defined in:
- lib/glia/errors/error.rb
Overview
Base error
Direct Known Subclasses
AuthorizationError, InputValidationError, InternalServerError, InvalidFormatError, InvalidLengthError, InvalidNumberError, InvalidResourceStateError, InvalidTypeError, InvalidValueError, LimitExceededError, MissingValueError, NotVerifiedError, RecipientOptedOutError, RemainingAssociationError, ResourceAlreadyExistsError, ResourceNotFoundError, ServiceUnavailableError, UnknownError
Constant Summary collapse
- SNAKE_CASE_REGEX =
/^[a-z0-9]+(_[a-z0-9]+)*$/.freeze
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
Returns a new instance of Error.
10 11 12 13 14 15 |
# File 'lib/glia/errors/error.rb', line 10 def initialize(type:, ref:, message: nil, error_details: nil) @type = type @ref = ref @message = @error_details = error_details end |
Instance Attribute Details
#error_details ⇒ Object (readonly)
Returns the value of attribute error_details.
8 9 10 |
# File 'lib/glia/errors/error.rb', line 8 def error_details @error_details end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
8 9 10 |
# File 'lib/glia/errors/error.rb', line 8 def @message end |
#ref ⇒ Object (readonly)
Returns the value of attribute ref.
8 9 10 |
# File 'lib/glia/errors/error.rb', line 8 def ref @ref end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
8 9 10 |
# File 'lib/glia/errors/error.rb', line 8 def type @type end |
Instance Method Details
#to_h ⇒ Object
17 18 19 20 21 |
# File 'lib/glia/errors/error.rb', line 17 def to_h { type: type, ref: ref, message: , error_details: error_details_to_h(@error_details) }.compact end |