jsonfmt: Improve error handling.