From: Ian Jackson Date: Fri, 11 Apr 2014 16:17:01 +0000 (+0100) Subject: topicedit: add a timeout; better error handling X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?p=ircbot.git;a=commitdiff_plain;h=HEAD topicedit: add a timeout; better error handling --- diff --git a/topicedit.tcl b/topicedit.tcl index 9fc4765..8899878 100755 --- a/topicedit.tcl +++ b/topicedit.tcl @@ -9,9 +9,11 @@ manyset $argv host port nick ident ownfullname channel topicinfo set done 0 +after 30000 { set errorInfo {}; bgerror timeout } + proc bgerror {msg} { global errorInfo errorCode - puts stderr "$msg\n$errorCode\n$errorInfo\n" + puts stderr "$msg\n$errorCode\n$errorInfo\n\nERROR: $msg\n" exit 16 }