bbc / alephant-broker

Brokers requests for alephant components
MIT License
4 stars 3 forks source link

[Ready] Error Handling in ComponentFactory #18

Closed revett closed 10 years ago

revett commented 10 years ago

Problem

image.gif

darnould commented 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)

darnould commented 10 years ago

:cake: