Is a 'recoverable error' interface more efficient than handling recovery in multiple 'catch' blocks?
问题 So, this is a re-ask of another question that was closed for being opinion based. So I'm re-asking my question in a more factual manner. So, as the title says, I'm unsure if I should try to implement recoverable error classes or just stick with trying to recover in a catch block. Some psuedo-code to demonstrate: // more or less what I have now postToServer(data) { try { socket.write(data) } //Interrupted being a custom exception catch(Interrupted ex) { //happened twice is a common static