File: myapp_request_handler.tcl

package info (click to toggle)
libapache2-mod-rivet 3.2.0-1
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 5,868 kB
  • sloc: xml: 8,496; tcl: 7,212; ansic: 6,959; sh: 5,030; makefile: 261; sql: 91; lisp: 78
file content (46 lines) | stat: -rw-r--r-- 925 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# -- myapp_request_handler.tcl
#
# This script will be read by mod_rivet during the process/thread
# initialization stage and its content stored in a Tcl_Obj object.
# This object is evaluated internally by mod_rivet at every request
#

::try {

    ::theApplication request_processing [::rivet::var_qs all]

} trap {RIVET ABORTPAGE} {err opts} {

    set abort_code [::rivet::abort_code]

    switch $abort_code {
        code1 {
            # handling abort_page with code1
            ....
        }
        code2 {
            # handling abort_page with code2
            ....      
        }
        default {
            # default abort handler
        }
    }

} trap {RIVET THREAD_EXIT} {err opts} {
    
    # myApplication sudden exit handler
    ...

} on error {err opts} {

    # myApplication error handler
    ...

} finally {

    # request processing final elaboration
    
}

# -- myapp_request_handler.tcl