Exception: Druid::DataSource::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Druid::DataSource::Error
- Defined in:
- lib/druid/data_source.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#error_class ⇒ Object
readonly
Returns the value of attribute error_class.
-
#error_message ⇒ Object
readonly
Returns the value of attribute error_message.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(response) ⇒ Error
constructor
A new instance of Error.
- #message ⇒ Object
- #query_cancelled? ⇒ Boolean
- #query_interrupted? ⇒ Boolean
- #query_timeout? ⇒ Boolean
- #resource_limit_exceeded? ⇒ Boolean
- #unknown_exception? ⇒ Boolean
Constructor Details
#initialize(response) ⇒ Error
Returns a new instance of Error.
90 91 92 93 94 95 96 97 98 99 |
# File 'lib/druid/data_source.rb', line 90 def initialize(response) @response = response parsed_body = MultiJson.load(response.body) @error, @error_message, @error_class, @host = parsed_body.values_at(*%w( error errorMessage errorClass host )) end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
88 89 90 |
# File 'lib/druid/data_source.rb', line 88 def error @error end |
#error_class ⇒ Object (readonly)
Returns the value of attribute error_class.
88 89 90 |
# File 'lib/druid/data_source.rb', line 88 def error_class @error_class end |
#error_message ⇒ Object (readonly)
Returns the value of attribute error_message.
88 89 90 |
# File 'lib/druid/data_source.rb', line 88 def @error_message end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
88 89 90 |
# File 'lib/druid/data_source.rb', line 88 def host @host end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
88 89 90 |
# File 'lib/druid/data_source.rb', line 88 def response @response end |
Instance Method Details
#message ⇒ Object
101 102 103 |
# File 'lib/druid/data_source.rb', line 101 def error end |
#query_cancelled? ⇒ Boolean
113 114 115 |
# File 'lib/druid/data_source.rb', line 113 def query_cancelled? error == 'Query cancelled'.freeze end |
#query_interrupted? ⇒ Boolean
109 110 111 |
# File 'lib/druid/data_source.rb', line 109 def query_interrupted? error == 'Query interrupted'.freeze end |
#query_timeout? ⇒ Boolean
105 106 107 |
# File 'lib/druid/data_source.rb', line 105 def query_timeout? error == 'Query timeout'.freeze end |
#resource_limit_exceeded? ⇒ Boolean
117 118 119 |
# File 'lib/druid/data_source.rb', line 117 def resource_limit_exceeded? error == 'Resource limit exceeded'.freeze end |
#unknown_exception? ⇒ Boolean
121 122 123 |
# File 'lib/druid/data_source.rb', line 121 def unknown_exception? error == 'Unknown exception'.freeze end |