Give me a straight forward answer to when I should use try and catch?
Should I wrap every SQL query in try and catch? Or should I only use try and catch where I can do something?
Ex: server timed out, try reconnecting
ask professor krishnamurti :)
>>59451609
don't giving me a meme answer?
>>59451594
Isn't the pic self explanatory? You put try catch blocks where an exception may be thrown and you want to handle it differently than the default way (usually stopping operation).
>should I wrap every SQL query in try and catch?
You should probably use some sort of handling object/API for queries. Said object/API should have a try catch block.
>>59451594
It's the enterprise version of goto. Use in case you need goto, but goto isn't enterprise enough for your peers/boss/client.
>>59451594
>Every sql query
You only need one function to handle queries in any given project. If you have more than one please visit HR on your way out