Exception: EML::RESTError
- Inherits:
-
Error
- Object
- StandardError
- Error
- EML::RESTError
show all
- Extended by:
- T::Sig
- Defined in:
- lib/eml/error/rest.rb
Overview
RESTError is the parent class for errors related to connections to the EML REST Web Services APIs
Instance Attribute Summary
Attributes inherited from Error
#message
Instance Method Summary
collapse
Constructor Details
#initialize(message = nil, response = nil) ⇒ RESTError
Returns a new instance of RESTError.
16
17
18
19
20
|
# File 'lib/eml/error/rest.rb', line 16
def initialize(message = nil, response = nil)
super(message)
@response = T.let(response, T.nilable(EML::Response))
end
|
Instance Method Details
#http_body ⇒ Object
23
24
25
|
# File 'lib/eml/error/rest.rb', line 23
def http_body
@response&.error || @response&.body&.to_s
end
|
28
29
30
|
# File 'lib/eml/error/rest.rb', line 28
def
@response&.
end
|
#http_status ⇒ Object
33
34
35
|
# File 'lib/eml/error/rest.rb', line 33
def http_status
@response&.http_status
end
|
#url ⇒ Object
38
39
40
|
# File 'lib/eml/error/rest.rb', line 38
def url
@response&.url&.to_s
end
|