From 7bdfdfe5fd17c547d0332b4f9fc0b3f997e790ed Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 13 Nov 1995 18:17:46 +0000 Subject: [PATCH] Better error handling. --- www/Makefile | 7 +++-- www/noway.gif | Bin 0 -> 961 bytes www/query.egw | 81 ++++++++++++++++++++++++++++++++++++++++--------------- www/search.egw | 26 +++++++++++++++--- www/z39util.tcl | 40 ++++++++++++++++++--------- 5 files changed, 115 insertions(+), 39 deletions(-) create mode 100644 www/noway.gif diff --git a/www/Makefile b/www/Makefile index a00542d..4c97ecb 100644 --- a/www/Makefile +++ b/www/Makefile @@ -2,7 +2,10 @@ # Europagate, 1995 # # $Log: Makefile,v $ -# Revision 1.14 1995/11/13 15:41:40 adam +# Revision 1.15 1995/11/13 18:17:46 adam +# Better error handling. +# +# Revision 1.14 1995/11/13 15:41:40 adam # Arrow gifs. # Gateway uses record element set names B(rief) and F(ull). # Bug fix. Didn't save idAuthentication correctly. @@ -68,7 +71,7 @@ WSCRIPTS=egwscript targets.egw query.egw search.egw showfull.egw z39util.tcl \ mtargets.egw mquery.egw msearch.egw HSCRIPTS=egwindex.html CONFFILES=ztargets.conf -GIFFILES=webgate.gif darrw.gif uarrw.gif +GIFFILES=webgate.gif darrw.gif uarrw.gif noway.gif TPROG1=egwcgi TPROG2=egwsh TPROG3=wtest diff --git a/www/noway.gif b/www/noway.gif new file mode 100644 index 0000000000000000000000000000000000000000..1a291b628416ecdf4a0363f88779881e39c040cf GIT binary patch literal 961 zcmXX_OGuPa6h4XMY-%E79B2Mi1X8Cc%uTomgf?wl1Q9`}@BVmU=FYw6^*!#K?(6M3dL^KMe%BFJ z7=6NM3vmj=6|9Yw>iezL`NieR>|%MUdwRBWyqvmxjgFi!XU1fxGBS49u;a^^jm21v z&4f&x37d$CnwTk>I#V_kQ#D0_Z-i9D5{X1ZLqjr|Y;0^yrBdm1ItYSHCezf^l+9+F zo11gFTt1&K6bi*+u~aG%VJ;I1k@}y`kz;Z~4oCA50AnT=VkI`8D2{|lghWXUb)=4z zNrhBNLBW9!aC@MB0Ggr;%5XG4!7p}BoKxq_55$Stu{c)8=I0|Q>_nWX6Z3G8tL#*q zs#98*p3w!|NMfHt+YxF`fq(vBKEMeA2X^_KYTnLLs!h*Op>A?+3048*S5MT}vURN%m1^hRs+f``aP7-uYvEQN}oh{?Fn z$YF>I#sGpiJci-k8>kPtp>O0rq=X)TiE79JOdt$~K#gVqjY_}*4h%+bw8mpWF|rZH z84GU*c0o%}#AICH1$x(Ea}@DzdESu$_IImNc@~D@_KS_S?H6m7`%}AvsE!WcIpZG@ z5XELF9t+M~zx#Tkw!Z!Bt%cm1$vv6=+p)1q4<+5P`PPM8?<5`W9a$YL_B<%XYX-W; zy89db)4u->){eU#ELUQ#aa{TEEPkd{pysZfWl8!@m3Z zT^C+w}-Tb*;&93cy_wDiMhvguC?^Vaz$nezO%^#PZ9Nhf= Mwp?G>9i!v_0of<85C8xG literal 0 HcmV?d00001 diff --git a/www/query.egw b/www/query.egw index 48a03ba..4d3d365 100644 --- a/www/query.egw +++ b/www/query.egw @@ -4,7 +4,7 @@ { -# $Id: query.egw,v 1.15 1995/11/13 15:41:42 adam Exp $ +# $Id: query.egw,v 1.16 1995/11/13 18:17:47 adam Exp $ if {[info commands saveState] == ""} { source z39util.tcl @@ -26,15 +26,14 @@ proc ok-response {} { set host [lindex $sessionParms 0] - if {[info exists setNo]} { - set oldHost $hist($setNo,host) - } else { - set oldHost "" - } if {[catch {set setNo $nextSetNo}]} { set nextSetNo 1 set setNo 1 } + if {[catch {set oldHost [z39 connect]}]} { + set oldHost "" + } + set hist($setNo,host) $host set hist($setNo,idAuthentication) [lindex $targets($host) 3] @@ -51,43 +50,59 @@ proc ok-response {} { set sessionWait 0 if {[catch {z39 connect $host}]} { - html "Cannot connect to target ${host}
\n" + displayError "Cannot connect to target ${host}" {} html "\n" + z39 disconnect wabort } elseif {$sessionWait == 0} { if {[catch {zwait sessionWait 30}]} { - html "Cannot connect to target ${host}
\n" + displayError "Cannot connect to target ${host}" {} html "\n" z39 disconnect wabort } if {$sessionWait != 1} { - html "Cannot connect to target ${host}
\n" + displayError "Cannot connect to target ${host}" {} html "\n" z39 disconnect wabort } } set sessionWait 0 -# z39 idAuthentication $hist($setNo,idAuthentication) + z39 idAuthentication $hist($setNo,idAuthentication) if {[catch {z39 init}]} { - htmlr "Cannot initialize with target ${host}
" - htmlr "" + displayError "Cannot initialize target ${host}" {} + html "\n" wabort } if {[catch {zwait sessionWait 60}]} { - htmlr "Cannot initialize with target ${host}
" - htmlr "" + displayError "Cannot initialize target ${host}" {} + html "\n" wabort } if {$sessionWait != "1"} { - htmlr "Cannot initialize with target ${host}
" + displayError "Cannot initialize target ${host}" {} + htmlr "\n" + wabort + } + if {![z39 initResult]} { + displayError "Connection rejected by target ${host}" \ + [z39 userInformationField] + z39 disconnect htmlr "" wabort } } set databases [lindex $targets($host) 1] + if {$setNo > 1 && $hist([expr $setNo - 1],host) == $host} { + set oSetNo [expr $setNo - 1] + set databaseDefault $hist($oSetNo,database) + } else { + set databaseDefault [lindex $databases 0] + set oSetNo 0 + } + html {
} \n set nodb [llength $databases] @@ -100,7 +115,7 @@ proc ok-response {} { set i 0 foreach d $databases { html { } $d \n } else { html {" checked> } $d \n @@ -119,16 +134,30 @@ proc ok-response {} { set fields [lindex $targets($host) 2] for {set no 1} {$no < 4} {incr no} { html {\n" - html {} \n + html {} \n if {$no < 3} { html {\n" } html "
\n" @@ -141,7 +170,15 @@ Alternatively you can enter your query in

Various technical parameters:


-Max hits: +{ + html {Max hits: } +} Records are shown in: