Exception: Yt::Errors::RequestError
- Inherits:
-
StandardError
- Object
- StandardError
- Yt::Errors::RequestError
show all
- Defined in:
- lib/yt/errors/request_error.rb
Instance Method Summary
collapse
Constructor Details
Returns a new instance of RequestError.
4
5
6
7
|
# File 'lib/yt/errors/request_error.rb', line 4
def initialize(msg = {})
@msg = msg
super msg
end
|
Instance Method Details
#kind ⇒ Object
20
21
22
|
# File 'lib/yt/errors/request_error.rb', line 20
def kind
response_body.fetch 'error', {}
end
|
#message ⇒ Object
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/yt/errors/request_error.rb', line 9
def message
<<-MSG.gsub(/^ {8}/, '')
#{explanation}:
#{response_body}
You can retry the same request manually by running:
#{request_curl}
#{more_details}
MSG
end
|
#reasons ⇒ Object
24
25
26
|
# File 'lib/yt/errors/request_error.rb', line 24
def reasons
kind.fetch('errors', []).map{|e| e['reason']}
end
|