Improve error response parsing