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?
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?
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.
SwiftShort answerAdvanced
You're designing a network layer with async/await. For error handling in the request…
#result #typed-throws
NetworkingMultiple choiceBasics
An idempotent GET request failed. Select all the failures where an automatic retry (with…
#http-status
NetworkingShort answerExpert
In a one-hour exercise you're asked to build an app that calls a public API and shows the…
#error-handling
NetworkingShort answerBasics
In a phone screen you're asked to design a simple networking layer in Swift. Without…
#error-handling