Exception: HelloSign::Error
- Inherits:
-
StandardError
- Object
- StandardError
- HelloSign::Error
- Defined in:
- lib/hello_sign/error.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(message = nil, status_code = nil) ⇒ Error
constructor
A new instance of Error.
- #to_s ⇒ Object
Constructor Details
#initialize(message = nil, status_code = nil) ⇒ Error
Returns a new instance of Error.
32 33 34 |
# File 'lib/hello_sign/error.rb', line 32 def initialize( = nil, status_code = nil) @message, @status_code = , status_code end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
3 4 5 |
# File 'lib/hello_sign/error.rb', line 3 def @message end |
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
3 4 5 |
# File 'lib/hello_sign/error.rb', line 3 def status_code @status_code end |
Class Method Details
.from_error_name(error_name) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/hello_sign/error.rb', line 5 def self.from_error_name(error_name) case error_name when 'bad_request' BadRequest when 'unauthorized' Unauthorized when 'forbidden' Forbidden when 'not_found' NotFound when 'unknown' Unknown when 'team_invite_failed' TeamInviteFailed when 'invalid_recipient' InvalidRecipient when 'convert_failed' ConvertFailed when 'signature_request_cancel_failed' SignatureRequestCancelFailed when 'maintenance' Maintenance else Error end end |
Instance Method Details
#to_s ⇒ Object
36 37 38 |
# File 'lib/hello_sign/error.rb', line 36 def to_s status_code ? : end |