How to avoid displaying database related error
#1
I have a long script to execute and sometime maximum script execution time limit reached right at the moment of "Update query" which cause a detailed error revealing complete sql query, I want to avoid it , I don't want that system displays detailed error How can I avoid this???


   
Reply
#2
Not much you can do here, however if this script is running regularly I would seriously consider a rewrite of the script to stop you from running into this issue.

What are you doing with it exactly?

Whatever it is it is actually killing mysql or blocking your connection to it
Reply
#3
(2014-07-19, 02:30 PM)Dannymh Wrote: Not much you can do here, however if this script is running regularly I would seriously consider a rewrite of the script to stop you from running into this issue.

What are you doing with it exactly?

Whatever it is it is actually killing mysql or blocking your connection to it

Nothing is overkilling mysql, My script has to download message images and finally update moderator log and if there are a lot of images then script execution limit can easily be reached Many host like 000webhost only allow 10 seconds of window
Reply
#4
You can catch these before they fail.

That is your only real option to try and trap the errors before they display, you could alway check the size or amount of images first and stop the script at xKB OR x image and then reload the script. The same way the recount tasks work.

Other than that you could run this from a task or a cron and that way stop front end users from ever seeing them.

It's about mitigation and preventing errors rather than anything else.

The other method is to use the error hook of the page output hooks and alter the output if an error with db info is found
Reply
#5
I believe this actually can be turned off.

ACP->Config->Server & Optimization Settings. Look for Error Type Medium. Set that to Hide Errors & Warnings.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)