4 ms·
First of all, the way of handling the errors really shouldn't depend on the size of the project. Nobody is ever going to rewrite their error handling just becau
by tomas789 8y ago
First of all, the way of handling the errors really shouldn't depend on the size of the project. Nobody is ever going to rewrite their error handling just because the project grew up.
Second, and likely more important fact is that the server returning the non-4xx status code is not quite an exception. It is just one step away from your happy-path. The mechanism of exceptions should be used for things that you don't expect. Mostly because of the cost they imply on the runtime (at least for C++ and similar languages which do stack unwinding and not so much for Swift, which treats the exceptions as just a different returned value with almost zero runtime cost).