lib/acfs/errors.rb in acfs-1.7.0 vs lib/acfs/errors.rb in acfs-2.0.0
- old
+ new
@@ -4,11 +4,11 @@
# Acfs base error.
#
class Error < StandardError
def initialize(opts = {}, message = nil)
opts[:message] = message if message
- super opts[:message]
+ super(opts[:message])
end
end
class UnsupportedOperation < StandardError; end
@@ -18,11 +18,11 @@
def initialize(request, message)
@request = request
message = "#{message}: #{request.method.upcase} #{request.url}"
- super message: message
+ super(message: message)
end
end
class TimeoutError < RequestError
def initialize(request)
@@ -38,17 +38,17 @@
def initialize(opts = {})
@response = opts[:response]
message = if response
(opts[:message] ? "#{opts[:message]}:" : 'Received') +
- " #{response.code} for #{response.request.method.upcase}" \
- " #{response.request.url} #{response.request.format}"
+ " #{response.code} for #{response.request.method.upcase} " \
+ "#{response.request.url} #{response.request.format}"
else
opts[:message] || 'Received erroneous response'
end
- super opts, message
+ super(opts, message)
end
end
class AmbiguousStubError < Error
attr_reader :stubs, :operation
@@ -61,10 +61,10 @@
message = "Ambiguous stubs for #{operation.action} " \
"on #{operation.resource}.\n" +
stubs.map {|s| " #{s.opts.pretty_inspect}" }.join
- super opts, message
+ super(opts, message)
end
end
# 400
class BadRequest < ErroneousResponse; end