File: catch.rvt

package info (click to toggle)
libapache2-mod-rivet 3.2.2-1
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 6,296 kB
  • sloc: xml: 8,554; tcl: 7,568; ansic: 7,094; sh: 5,017; makefile: 195; sql: 91; lisp: 78
file content (38 lines) | stat: -rw-r--r-- 887 bytes parent folder | download | duplicates (5)
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
<?
    proc failproc {arg1} {
        switch $arg1 {
            1 {
                fail
            }
            3 {
                return -code error -options [dict create argument $arg1 code error] "errore"
            }
        }
    }

    switch [::rivet::var_qs get abort] {
        1 {
            if {[::rivet::catch {failproc 1}]} {
                puts -nonewline "OK"
            }
        }
        2 {
            if {[::rivet::catch {::rivet::abort_page}]} {
                ?>should never get here if AbortScript is defined<?
            }
        }
        3 {
            if {[::rivet::catch {failproc 3} er opt]} {
                dict with opt {
                    puts -nonewline "$argument $code"
                }
            }
        }
        default {
            if {![::rivet::catch {set a 1}]} {
                ?>OK<?
            }
        }
    }

?>