Cleaned up the error formatting code, added support for another error handler.
Cleaned up the error formatting code, added support for another error handler.

ghxandsky/harlan,eholk/harlan,eholk/harlan,ghxandsky/harlan,eholk/harlan,eholk/harlan,ghxandsky/harlan,eholk/harlan