]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
tcl daemons: Recognise `SSL SYSCALL' errors with their own errorCode
authorIan Jackson <ian.jackson@eu.citrix.com>
Thu, 7 Jul 2016 16:47:02 +0000 (17:47 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 14 Jul 2016 12:32:49 +0000 (13:32 +0100)
This has no real effect right now but will be useful in a moment.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
tcl/JobDB-Executive.tcl

index 4d5f2f28e130b040f1ccf300a68f9f2771ac0d1d..8c9681102766d44db48d9c6e67a6212408960abc 100644 (file)
@@ -171,9 +171,16 @@ proc db--exec-check {shvar stmt expected_status body} {
            }
            set context [pg_result $sh -error context]
            set emsg "db exec failed ($status, $sqlstate) $emsg"
+           set ecode OSSTEST-PSQL
+           if {![string length $sqlstate] &&
+               [string match {SSL SYSCALL *} $emsg]} {
+               # sadly the pg client library doesn't provide a code
+               # for this so we match the error message
+               set ecode OSSTEST-PSQL-SSL-SYSCALL
+           }
            error $emsg \
  "$emsg\n    while executing SQL\n$stmt\n    in SQL context\n$context" \
-               [list OSSTEST-PSQL $status $sqlstate]
+               [list $ecode $status $sqlstate]
        }
        uplevel 1 $body
     } emsg]