tcl-websh-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@dedasys.com (David N. Welton)
Subject 'catch' web::dispatch
Date Tue, 27 Nov 2001 12:07:04 GMT

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4729

Situation: want a global catch across all web::command procs
    # global error catcher
    if {[catch {web::dispatch -hook {logHttpRequest; normalizeHttpRequest}} errMsg]} {
        # we signal every error to the client
        web::log pisa.error ""Exception: $errMsg""
        sendHttpErrorResponse ""Exception: $errMsg""
    }

  Problem: web::dispatch catches possible errors and modifies errorMessage
  -> the original errorMessage is not available anymore

  Suggestion: remove catch from web::dispatch or do not modify original
  error message

This bit of code above is specific to some app or another... what is
the real problem here?

What would be a simple test case to demonstrate the problem?

web::command default {
    BLARGH
}

if { [catch {web::dispatch} errmsg] } {
    # we signal every error to the client
    web::put $errmsg
    web::put $errmsg
}

Is something I've tried, but I don't quite see the problem...

-- 
David N. Welton
   Consulting: http://www.dedasys.com/
Free Software: http://people.debian.org/~davidw/
   Apache Tcl: http://tcl.apache.org/
     Personal: http://www.efn.org/~davidw/

Mime
View raw message