Bug 4729 - Catch in web::dispatch disrupts error message
Summary: Catch in web::dispatch disrupts error message
Status: RESOLVED WORKSFORME
Alias: None
Product: WebSH
Classification: Unclassified
Component: WebSH (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal (vote)
Target Milestone: ---
Assignee: websh-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-11-07 15:11 UTC by David N. Welton
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David N. Welton 2001-11-07 15:11:07 UTC
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
Comment 1 David N. Welton 2001-12-11 13:48:02 UTC
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...
Comment 2 David N. Welton 2002-02-13 21:08:36 UTC
> could you try to give a simple sample that shows the problem clearly?

> > * 4729: catch used with web::dispatch.
> >
> >   The provided example isn't something reproducable.  Unclear what the
> >   exact problem is, and am hoping that a test case might be made
> >   available which illustrates the problem.

This request came from one of our developers, dated Apr, 2001. Nor he
nor myself can reproduce the problem now: catching web::dispatch seems
to work as expected - I suggest to drop the issue.