Exception: WebfleetConnect::Error
- Inherits:
-
StandardError
- Object
- StandardError
- WebfleetConnect::Error
- Defined in:
- lib/webfleet_connect/error.rb
Constant Summary collapse
- SITE =
'https://www.webfleet.com'
- PATH =
'/static/help/webfleet-connect/en_gb/index.html'
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(message, url, is_json) ⇒ Error
constructor
A new instance of Error.
- #message ⇒ Object
Constructor Details
#initialize(message, url, is_json) ⇒ Error
Returns a new instance of Error.
11 12 13 14 15 16 17 |
# File 'lib/webfleet_connect/error.rb', line 11 def initialize(, url, is_json) parser = build_parser(is_json) hash = parser.to_hash() @code = hash[:errorCode] @message = hash[:errorMsg] @url = url end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
9 10 11 |
# File 'lib/webfleet_connect/error.rb', line 9 def code @code end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
9 10 11 |
# File 'lib/webfleet_connect/error.rb', line 9 def url @url end |
Instance Method Details
#message ⇒ Object
19 20 21 |
# File 'lib/webfleet_connect/error.rb', line 19 def "#{code}, #{@message}\n\nCheck #{api_docs_url} for more details.\n\n" end |