I have an eggdrop that uses fbsql to connect to a mysl dbase and run querys. 90% of the time this goes smoothly but the other 10% of the time i get an error simmilar to the following.
Tcl error [join:chan]: Error 2013 (Lost connection to MySQL server during query)
Ok now I know what it means and the process here is not important.
What I would like to know is how I can deal with this.
for eg could I get the bot to echo the error to a specified chan and also could I get it upon recieving error it will try again upto a maximum of say 5 times.
Im kinda a noob at this stuff and i seem to stumble along as i go any and all help appreciated thank you.
You can use the trace command and the errorInfo variable. I wrote a tutorial on doing it for a friend a while ago - have a read here - just modify the middle bit of the code and replace it with your code to msg a channel
MD87 wrote:You can use the trace command and the errorInfo variable.
Cool idea I think this might be something that GodOfSuicide could use for the issue he's mentioning in this post, untill (if it ever happens) eggdrop has been updated the way he wants.
However, I don't think it'll solve ShavedApe's problem.
ShavedApe wrote:What I would like to know is how I can deal with this.
for {set i 0} {$i<5} {incr i} {
if {[catch {
# insert code causing error here...
} result]} {
# there was an error...reopen the database connection or whatever you need to do
} {
# everything went fine...display the result or whatever and 'break' to exit the for-loop
}
}