Error checking after sql queries in installer/uninstaller?

rugk

Active member
As there is no error checking after mysql queries in any code of a development tutorial here in XenForo I just want to ask: Is it not necessary to check sql errors by yourself (and throw an exception in case there is one) because XenForo already does this all?

Or would it be not a bad idea to add an error check after an sql query (e.g. in the installer class) and check manually whether the query was successful?
 
The decision is up to you. If you check and catch them, you can recover from it. If you don't, the query will fail and you will have to deal with it later.
 
Well... okay, so there is a need for error checking there.
And as for the installer class?
As there is not really something you can recover if it fails you always have to stop the installation (by throwing an exception). XenForo seems to already cover many errors which can occur in the sql query - that's the reason for my question.
So is it needed/useful there to check (again) for errors or this this redundant?
 
Back
Top Bottom