Skip to content
Snippets Groups Projects
Commit 10901433 authored by inertia's avatar inertia
Browse files

tracking more narrow timeout errors

parent bd3468df
No related branches found
No related tags found
No related merge requests found
Pipeline #13983 canceled
......@@ -19,17 +19,21 @@ module Hive
end
if error.message.include? 'Internal Error'
raise Hive::RemoteNodeError, error.message, build_backtrace(error)
raise Hive::RemoteInternalError, error.message, build_backtrace(error)
end
if error.message.include? 'Server error'
raise Hive::RemoteNodeError, error.message, build_backtrace(error)
raise Hive::RemoteServerError, error.message, build_backtrace(error)
end
if error.message.include? 'plugin not enabled'
if error.message.include?('plugin not enabled') || error.message.include?('Could not find API')
raise Hive::PluginNotEnabledError, error.message, build_backtrace(error)
end
if error.message.include? 'Supported by hivemind'
raise Hive::MethodNotEnabledError, error.message, build_backtrace(error)
end
if error.message.include? 'argument'
raise Hive::ArgumentError, "#{context}: #{error.message}", build_backtrace(error)
end
......@@ -210,9 +214,12 @@ module Hive
class IncorrectRequestIdError < BaseError; end
class IncorrectResponseIdError < BaseError; end
class RemoteNodeError < BaseError; end
class RemoteInternalError < BaseError; end
class RemoteServerError < BaseError; end
class UpstreamResponseError < RemoteNodeError; end
class RemoteDatabaseLockError < UpstreamResponseError; end
class PluginNotEnabledError < UpstreamResponseError; end
class MethodNotEnabledError < UpstreamResponseError; end
class RequestTimeoutUpstreamResponseError < UpstreamResponseError; end
class BadOrMissingUpstreamResponseError < UpstreamResponseError; end
class TransactionIndexDisabledError < BaseError; end
......
......@@ -18,7 +18,8 @@ module Hive
# @private
TIMEOUT_ERRORS = [Net::OpenTimeout, JSON::ParserError, Net::ReadTimeout,
Errno::EBADF, IOError, Errno::ENETDOWN, Hive::RemoteDatabaseLockError,
Hive::RequestTimeoutUpstreamResponseError, Hive::RemoteNodeError]
Hive::RequestTimeoutUpstreamResponseError, Hive::RemoteServerError,
Hive::RemoteServerError]
# @private
POST_HEADERS = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment