Module: BigQuery::Client::Errors
- Included in:
- BigQuery::Client
- Defined in:
- lib/big_query/client/errors.rb
Instance Method Summary collapse
-
#handle_error(response) ⇒ Object
handles the error and raises an understandable error.
-
#is_error?(response) ⇒ Boolean
Defines whenever the response is an error or not.
Instance Method Details
#handle_error(response) ⇒ Object
handles the error and raises an understandable error
16 17 18 19 20 21 22 23 24 |
# File 'lib/big_query/client/errors.rb', line 16 def handle_error(response) error = response['error'] case error['code'] when 404 fail BigQuery::Errors::NotFound, error['message'] else fail BigQuery::Errors::BigQueryError, error['message'] end end |
#is_error?(response) ⇒ Boolean
Defines whenever the response is an error or not
8 9 10 |
# File 'lib/big_query/client/errors.rb', line 8 def is_error?(response) !response["error"].nil? end |