Closed revett closed 10 years ago
Phenomenal gif.
I know these weren't introduced by this PR but:
Use of is_a?
(in format_content_for
) is normally a cause for concern, as it's usually trying to reinvent polymorphism. format_content_for
as a name does suggest that there should be a content
method to be dynamically dispatched.
The .nil?
guard at the start indicates something might be worth changing too.
The layer of abstraction provided by RequestFailed
might have provided an opportunity to resolve these issues, by supporting #content
, which shows the stack trace in the proper way (it could show the stack trace of the exception it is composed of)
:cake:
Problem
format_content_for
was accessing e instead of using body.RequestFailed
meant that the stack trace wasn't fully available in the response, I had to pry into the Broker to see what was going wrong.Solution
e
=>body
.RequestFailed
.