Fix Error.name field.
Refactor error handling in catchall.