Support --json in catchall exception handler