The 404 response for /u/{username}.json returns JSON as expected:
{"errors":["The requested URL or resource could not be found."],"error_type":"not_found"}
However, /u/by-external/{external_id}.json doesn’t have the same behaviour. It returns JSON on success, but HTML on 404 (and I would assume for other errors as well), confusing my JSON parser.