[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 26/33] tcl daemons: Recognise `SSL SYSCALL' errors with their own errorCode



This has no real effect right now but will be useful in a moment.

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 tcl/JobDB-Executive.tcl | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tcl/JobDB-Executive.tcl b/tcl/JobDB-Executive.tcl
index 8f4ed98..3c2b4db 100644
--- a/tcl/JobDB-Executive.tcl
+++ b/tcl/JobDB-Executive.tcl
@@ -170,9 +170,16 @@ proc db--exec-check {shvar stmt expected_status body} {
                set emsg "osstest expected status $expected_status got $status"
            }
            set context [pg_result $sh -error context]
+           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 "db exec failed ($status, $sqlstate) $emsg" \
                "    while executing SQL\n$stmt\n    in SQL context\n$context" \
-               [list OSSTEST-PSQL $status $sqlstate]
+               [list $ecode $status $sqlstate]
        }
        uplevel 1 $body
     } emsg]
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.