Interview frequency: …
Short answer
Check the status code, headers, and body together; 2xx is success, 4xx is a problem with the request or permission, and 5xx is usually a temporary server problem.
Explanation
Convert the response into an understandable domain result instead of spreading HttpResponse across the UI. Distinguish 401 from 403, 404, and 429, and do not treat any body that arrives over the network as automatic success.
Common mistakes
- Treating any outcome other than an exception as success based on the status code.
- Retrying unfixable 4xx errors without changing the request.