class Fluent::BigQuery::Error
@abstract
Constants
- REGION_NOT_WRITABLE_MESSAGE
- RETRYABLE_ERROR_REASON
- RETRYABLE_INSERT_ERRORS_REASON
- RETRYABLE_STATUS_CODE
- SSL_UNEXPECTED_EOF_MESSAGE
Attributes
Public Class Methods
Source
# File lib/fluent/plugin/bigquery/errors.rb, line 49 def inherited(subclass) subclass.class_eval do class << self public :new end end end
Guard for instantiation
Source
# File lib/fluent/plugin/bigquery/errors.rb, line 60 def initialize(message, origin = nil) @origin = origin super(message || origin.message) end
Calls superclass method
Source
# File lib/fluent/plugin/bigquery/errors.rb, line 23 def retryable_error?(e) retryable_server_error?(e) || retryable_region_not_writable?(e) || retryable_ssl_unexpected_eof?(e) end
@param e [Google::Apis::Error]
Source
# File lib/fluent/plugin/bigquery/errors.rb, line 31 def retryable_error_reason?(reason) RETRYABLE_ERROR_REASON.include?(reason) end
Source
# File lib/fluent/plugin/bigquery/errors.rb, line 35 def retryable_insert_errors_reason?(reason) RETRYABLE_INSERT_ERRORS_REASON.include?(reason) end
Source
# File lib/fluent/plugin/bigquery/errors.rb, line 39 def retryable_region_not_writable?(e) e.is_a?(Google::Apis::ClientError) && e.status_code == 400 && e.message.include?(REGION_NOT_WRITABLE_MESSAGE) end
Source
# File lib/fluent/plugin/bigquery/errors.rb, line 27 def retryable_server_error?(e) e.is_a?(Google::Apis::ServerError) && RETRYABLE_STATUS_CODE.include?(e.status_code) end
Source
# File lib/fluent/plugin/bigquery/errors.rb, line 43 def retryable_ssl_unexpected_eof?(e) e.message.include?(SSL_UNEXPECTED_EOF_MESSAGE) end
Source
# File lib/fluent/plugin/bigquery/errors.rb, line 14 def wrap(e, message = nil) if retryable_error?(e) RetryableError.new(message, e) else UnRetryableError.new(message, e) end end
@param e [Google::Apis::Error] @param message [String]
Public Instance Methods
Source
# File lib/fluent/plugin/bigquery/errors.rb, line 81 def body @origin && @origin.respond_to?(:body) ? @origin.body : nil end
Source
# File lib/fluent/plugin/bigquery/errors.rb, line 65 def method_missing(name, *args) if @origin @origin.send(name, *args) else super end end
Calls superclass method
Source
# File lib/fluent/plugin/bigquery/errors.rb, line 73 def reason @origin && @origin.respond_to?(:reason) ? @origin.reason : nil end
Source
# File lib/fluent/plugin/bigquery/errors.rb, line 77 def status_code @origin && @origin.respond_to?(:status_code) ? @origin.status_code : nil end