Exception: Naver::Searchad::Api::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Naver::Searchad::Api::Error
- Defined in:
- lib/naver/searchad/api/errors.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#header ⇒ Object
readonly
Returns the value of attribute header.
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
Instance Method Summary collapse
- #backtrace ⇒ Object
-
#initialize(err, status_code: nil, header: nil, body: nil) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(err, status_code: nil, header: nil, body: nil) ⇒ Error
Returns a new instance of Error.
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/naver/searchad/api/errors.rb', line 9 def initialize(err, status_code: nil, header: nil, body: nil) @cause = nil if err.respond_to?(:backtrace) super(err.) @cause = err else super(err.to_s) end @status_code = status_code @header = header unless header.nil? @body = body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
7 8 9 |
# File 'lib/naver/searchad/api/errors.rb', line 7 def body @body end |
#header ⇒ Object (readonly)
Returns the value of attribute header.
6 7 8 |
# File 'lib/naver/searchad/api/errors.rb', line 6 def header @header end |
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
5 6 7 |
# File 'lib/naver/searchad/api/errors.rb', line 5 def status_code @status_code end |
Instance Method Details
#backtrace ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/naver/searchad/api/errors.rb', line 23 def backtrace if @cause @cause.backtrace else super end end |