713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
|
# request. If an error occurs while running that procedure, generate
# an HTTP reply that contains the error message.
#
wapp-before-dispatch-hook
wappInt-trace
set mname [dict get $wapp PATH_HEAD]
if {[catch {
if {$mname!="" && [llength [info commands wapp-page-$mname]]>0} {
wapp-page-$mname
} else {
wapp-default
}
} msg]} {
wapp-reset
wapp-reply-code "500 Internal Server Error"
wapp-mimetype text/html
wapp "<h1>Wapp Application Error</h1>\n"
wapp "<pre>\n"
wapp-escape-html $::errorInfo
wapp "</pre>\n"
dict unset wapp .new-cookies
}
# Transmit the HTTP reply
#
if {$chan=="stdout"} {
puts $chan "Status: [dict get $wapp .reply-code]\r"
|
|
>
|
<
|
<
>
|
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
|
# request. If an error occurs while running that procedure, generate
# an HTTP reply that contains the error message.
#
wapp-before-dispatch-hook
wappInt-trace
set mname [dict get $wapp PATH_HEAD]
if {[catch {
if {$mname!="" && [llength [info proc wapp-page-$mname]]>0} {
wapp-page-$mname
} else {
wapp-default
}
} msg]} {
wapp-reset
wapp-reply-code "500 Internal Server Error"
wapp-mimetype text/html
wapp-trim {
<h1>Wapp Application Error</h1>
<pre>%html($::errorInfo)</pre>
}
dict unset wapp .new-cookies
}
# Transmit the HTTP reply
#
if {$chan=="stdout"} {
puts $chan "Status: [dict get $wapp .reply-code]\r"
|