Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: And another stumper....

From: tim-johnsons::web::com at: 30-Aug-2007 15:22

On Wednesday 29 August 2007, Kai Peters wrote:
> I am testing my code and run the function below against a non-existent > mysql server: > > Hmm - thought that try should catch this but apparently other things > happen:
Kai, below is a basic code framework that I use for my rebol CGI scripts. Most relevant to error handling is the last two lines. I hope that you find this a helpful example cheers tim (code follows) ;; ====================================== application: [; execution block cgi/init ;; initialize cgi handler cgi/set[testservers: test-server-names] db-profile: ["*****" "*****" "127.0.0.1" "*****"] ;; mysql login info db[init db-profile] ;; log into mysql server main ;; code here db[close] cgi/close ] ;;====================================== ;; 'print-error is the error handling function except: [print-error disarm err ] if error? set/any 'err try application except