robinharms/betahaus.viewcomponent — pull request #3 by ixmatus (2013-07-04 20:58:54+00:00)
Title: Fixing naive catch-all exception handling

The ViewGroup callable is catching Exceptions and injecting more information into them (useful) but it's naively assuming all library authors write their exceptions and raise them using messages passed into the args.

This fixes that by checking if args is non-empty; if not it uses exc.__class__ instead (as we have no way of knowing how/where the library authors provide access to the exception message).

An example of an exception that would break the current implementation:

class MyException(MyException):
error = "Some Error"