Well, I mean I’m not, but this is the typical way we handle this. The response here is short and stout.
enum CoffeeHTTPError: Error {
case isTeapot
}
func diagnoseError(err: CoffeeHTTPError) {
switch err {
case .isTeapot:
return "The response is short and stout."
default:
return err
}
}
diagnoseError(err: window.incomingCoffeeNetworkError)