class Fluent::BigQuery::Error
@abstract
Constants
- RETRYABLE_ERROR_REASON
- RETRYABLE_INSERT_ERRORS_REASON
- RETRYABLE_STATUS_CODE
Attributes
origin[R]
Public Class Methods
inherited(subclass)
click to toggle source
Guard for instantiation
# File lib/fluent/plugin/bigquery/errors.rb, line 39 def inherited(subclass) subclass.class_eval do class << self public :new end end end
new(message, origin = nil)
click to toggle source
Calls superclass method
# File lib/fluent/plugin/bigquery/errors.rb, line 50 def initialize(message, origin = nil) @origin = origin super(message || origin.message) end
retryable_error?(google_api_error)
click to toggle source
# File lib/fluent/plugin/bigquery/errors.rb, line 21 def retryable_error?(google_api_error) e = google_api_error reason = e.respond_to?(:reason) ? e.reason : nil retryable_error_reason?(reason) || (e.is_a?(Google::Apis::ServerError) && RETRYABLE_STATUS_CODE.include?(e.status_code)) end
retryable_error_reason?(reason)
click to toggle source
# File lib/fluent/plugin/bigquery/errors.rb, line 29 def retryable_error_reason?(reason) RETRYABLE_ERROR_REASON.include?(reason) end
retryable_insert_errors_reason?(reason)
click to toggle source
# File lib/fluent/plugin/bigquery/errors.rb, line 33 def retryable_insert_errors_reason?(reason) RETRYABLE_INSERT_ERRORS_REASON.include?(reason) end
wrap(google_api_error, message = nil, force_unretryable: false)
click to toggle source
# File lib/fluent/plugin/bigquery/errors.rb, line 10 def wrap(google_api_error, message = nil, force_unretryable: false) e = google_api_error return UnRetryableError.new(message, e) if force_unretryable if retryable_error?(e) RetryableError.new(message, e) else UnRetryableError.new(message, e) end end
Public Instance Methods
body()
click to toggle source
# File lib/fluent/plugin/bigquery/errors.rb, line 71 def body @origin && @origin.respond_to?(:body) ? @origin.body : nil end
method_missing(name, *args)
click to toggle source
Calls superclass method
# File lib/fluent/plugin/bigquery/errors.rb, line 55 def method_missing(name, *args) if @origin @origin.send(name, *args) else super end end
reason()
click to toggle source
# File lib/fluent/plugin/bigquery/errors.rb, line 63 def reason @origin && @origin.respond_to?(:reason) ? @origin.reason : nil end
retryable?()
click to toggle source
# File lib/fluent/plugin/bigquery/errors.rb, line 75 def retryable? false end
status_code()
click to toggle source
# File lib/fluent/plugin/bigquery/errors.rb, line 67 def status_code @origin && @origin.respond_to?(:status_code) ? @origin.status_code : nil end