From fd54642c712e233445b491fd3e935c51b038bb38 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 7 Jul 2016 17:47:02 +0100 Subject: [PATCH] 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 --- 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 4d5f2f2..8c96811 100644 --- a/tcl/JobDB-Executive.tcl +++ b/tcl/JobDB-Executive.tcl @@ -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] -- 2.39.5