lib/yoti/errors.rb in yoti-1.7.1 vs lib/yoti/errors.rb in yoti-1.8.0

- old
+ new

@@ -5,19 +5,17 @@ # Raises exceptions related to API requests class RequestError < StandardError attr_reader :response def initialize(message, response = nil) - super(append_response_message(message, response)) + super(message) @response = response end - private + def message + return super if @response.nil? || @response.body.empty? - def append_response_message(message, response) - return message if response.nil? || response.body.empty? - - "#{message}: #{response.body}" + "#{super}: #{@response.body}" end end # Raises exceptions related to OpenSSL actions class SslError < StandardError; end