|
Because most times, there is nothing that you can do. In the last example if there were no "EAGAIN", then there would have been no "pcall" and no "if then". Even if there is something for you to do, it's only in one spot that you do it and it's not uncommon for that spot to be further up the stack. If you "nil, err", you have to "if then" back to the caller that cares.Likewise, you must do this every time that you might get "nil, err" because if you forget, then you have a potentially tricky bug to find. With pcall, if you forget, you have an angry user or developer and an extremely easy to spot fix for it. [1]-Andrew[1] whenever I rant like this, I think about what I'm missing. I think that it's possible that error issues become trickier when things are IO and thread heavy and when they're not separated correctly. The possibility has me worried for my own code. :)