4 ms·
I didn't really. IMHO as many in the comments stated, non-trivial "B" layer code makes the author's approach a mess. Also I don't personally agree with the ide
by seabrookmx 13y ago
I didn't really. IMHO as many in the comments stated, non-trivial "B" layer code makes the author's approach a mess.
Also I don't personally agree with the idea that exceptions communicate errors better. In his examples, he's taking an error code and converting it to an exception. Obviously all the information needed about that error is conveyed by the code, otherwise this approach wouldn't work.
Wrangling of this information shouldn't be happening in the middle of application logic. The return code should be acknowledged by the recipient so the necessary cleanup can be performed, then it should be piped to a central class in charge of printing/logging errors. Sprinkling these error code conversions all over the place makes things messy and hard to maintain.