lib/domoscio_rails/errors.rb in domoscio_rails-0.3.5 vs lib/domoscio_rails/errors.rb in domoscio_rails-0.3.6a

- old
+ new

@@ -8,10 +8,10 @@ attr_reader :request_url, :code, :details, :body, :request_params def initialize(request_url, code, details = {}, body = nil, request_params = {}) @request_url, @code, @details, @body, @request_params = request_url, code, details, body, request_params super(message) if message end - def message; @details.is_a?(Hash) ? @details.dig(:error, :message) : @details; end + def message; (@details.is_a?(Hash) && @details[:error].is_a?(Hash)) ? @details.dig(:error, :message) : @details; end end # ProcessingError from DomoscioRails class ProcessingError < Error attr_reader :request_url, :code, :details, :body, :request_params \ No newline at end of file