lib/cc/service/invocation/with_error_handling.rb in codeclimate-services-1.6.1 vs lib/cc/service/invocation/with_error_handling.rb in codeclimate-services-1.7.0
- old
+ new
@@ -14,30 +14,31 @@
ok: false,
params: e.params,
status: e.status,
endpoint_url: e.endpoint_url,
message: e.user_message || e.message,
- log_message: error_message(e)
+ log_message: error_message(e),
}
rescue => e
@logger.error(error_message(e))
{
ok: false,
message: e.message,
- log_message: error_message(e)
+ log_message: error_message(e),
}
end
private
def error_message(e)
- if e.respond_to?(:response_body)
- response_body = ". Response: <#{e.response_body.inspect}>"
- else
- response_body = ""
- end
+ response_body =
+ if e.respond_to?(:response_body)
+ ". Response: <#{e.response_body.inspect}>"
+ else
+ ""
+ end
- message = "Exception invoking service:"
+ message = "Exception invoking service:"
message << " [#{@prefix}]" if @prefix
message << " (#{e.class}) #{e.message}"
message << response_body
end
end