Request: Add util method to style object as error and use css class in output html
I have some scripts that's processing a large amount of files and from time to time, processing a file fails. Naturally if an exception is raised while I'm processing, I'd catch, log the exception (i.e., dump it) and continue. However this only dumps the exception styled as if it was any other normal object to be dumped. It seems the only way to get this red style is if there was a genuine uncaught exception.
There's no util method as far as I'm aware to style an object as if it as an error object so I was hoping I could add some custom styles to the dumped object to have it appear like an error and took a look at the output html. Not as trivial as I hoped since the styles are applied directly on the elements and not a simple css class I could apply.
So two requests:
- Add a method to easily style an output as an error.
- Error styles should be applied using css styles. Or perhaps in general, generate html that lends itself well to easily customize with css classes.