Daily iOS
Networking

API error design

You've found network-layer code that collapses every failure into completion(nil). As a senior engineer, how would you model API errors and carry them all the way to the screen?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

Model transport errors, HTTP status, decoding, and domain errors as a layered error type, propagate it with throws, and decide the user-facing message in one layer.

Share a question