handle non-JSON error response (html 404 in this case)