File: try.rvt

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 (41 lines) | stat: -rw-r--r-- 1,042 bytes parent folder | download | duplicates (4)
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
<?

    proc failproc {arg1} {

        switch $arg1 {
            0 {
                return -code ok
            }
            1 {
                return -code error -options [dict create cmd try condition 1] "Errore"
            }
            3 {
                return -code break -options [dict create cmd try condition 3] "Break"
            }
            4 {
                return -code continue -options [dict create cmd try condition 4] "Continue"
            }
            abort {
                ::rivet::abort_page arg1
            }
            exit {
                ::rivet::exit 101
            }
        }

    }

    ::rivet::try {
        failproc [::rivet::var_qs get cond]
    } on continue {er opt} {
        dict with opt { puts -nonewline "continue $cmd $condition " }
    } on error {er opt} {
        dict with opt { puts -nonewline "error $cmd $condition " }
    } on break {er opt} {
        dict with opt { puts -nonewline "break $cmd $condition " }
    } finally {
        puts -nonewline "finalize"
    }


?>