lib/redis_failover/errors.rb in redis_failover-0.3.0 vs lib/redis_failover/errors.rb in redis_failover-0.4.0
- old
+ new
@@ -1,7 +1,12 @@
module RedisFailover
class Error < StandardError
+ attr_reader :original
+ def initialize(msg = nil, original = $!)
+ super(msg)
+ @original = original
+ end
end
class InvalidNodeError < Error
end
@@ -9,11 +14,11 @@
def initialize(node, state)
super("Invalid state change `#{state}` for node #{node}")
end
end
- class NodeUnreachableError < Error
+ class NodeUnavailableError < Error
def initialize(node)
super("Node: #{node}")
end
end
@@ -21,18 +26,24 @@
end
class NoSlaveError < Error
end
- class FailoverServerUnreachableError < Error
+ class FailoverServerUnavailableError < Error
def initialize(failover_server_url)
- super("Unable to reach #{failover_server_url}")
+ super("Unable to access #{failover_server_url}")
end
end
class InvalidNodeRoleError < Error
def initialize(node, assumed, actual)
super("Invalid role detected for node #{node}, client thought " +
"it was a #{assumed}, but it's now a #{actual}")
+ end
+ end
+
+ class UnsupportedOperationError < Error
+ def initialize(operation)
+ super("Operation `#{operation}` is currently unsupported")
end
end
end
\ No newline at end of file