summaryrefslogtreecommitdiffabout
path: root/src
authorSergey Poznyakoff <gray@gnu.org.ua>2010-03-15 20:16:21 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2010-03-15 20:16:21 (GMT)
commit97cb49f1c40856804ccac5925459187b4d3724bb (patch) (side-by-side diff)
treeacf3fbd4f163ccf1970d0fc61efc6801c1da0dec /src
parent150f2f64e4e580c0d6ab75d4bee150a4369cc4f1 (diff)
downloadellinika-97cb49f1c40856804ccac5925459187b4d3724bb.tar.gz
ellinika-97cb49f1c40856804ccac5925459187b4d3724bb.tar.bz2
Update sql-error-handler definitions.
git-svn-id: file:///home/puszcza/svnroot/ellinika/trunk@542 941c8c0f-9102-463b-b60b-cd22ce0e6858
Diffstat (limited to 'src') (more/less context) (ignore whitespace changes)
-rw-r--r--src/cgi-bin/dict.scm49
-rw-r--r--src/cgi-bin/nea.scm47
-rw-r--r--src/ellinika/dico.scm10
3 files changed, 5 insertions, 21 deletions
diff --git a/src/cgi-bin/dict.scm4 b/src/cgi-bin/dict.scm4
index 4d301fb..9cd23a8 100644
--- a/src/cgi-bin/dict.scm4
+++ b/src/cgi-bin/dict.scm4
@@ -33,15 +33,10 @@ ifelse(IFACE,[CGI],(cgi:init))
;; Τα μέρη του λογου
(define part-of-speech '())
-(define (sql-error-handler err descr)
+(define (sql-error-handler key func fmt fmtargs data)
(format #t "<h1 class=\"error\">~A</h1>\n"
(_ "ΣΦΆΛΜΑ: σύνδεση με το λέξικο απέτυχε."))
- (with-output-to-port
- (current-error-port)
- (lambda ()
- (display err)
- (display ": ")
- (display descr))))
+ (apply format (current-error-port) fmt fmtargs))
(define (mk-dict-connect)
(let ((db-connection #f))
diff --git a/src/cgi-bin/nea.scm4 b/src/cgi-bin/nea.scm4
index b5a9af0..d6099d1 100644
--- a/src/cgi-bin/nea.scm4
+++ b/src/cgi-bin/nea.scm4
@@ -62,12 +62,7 @@ ifelse(IFACE,[CGI],(cgi:init))
(define (sql-error-handler err descr)
(format #t "<h1 class=\"error\">~A</h1>\n"
(_ "ΣΦΆΛΜΑ: σύνδεση με την βάση δεδομένων απέτυχε."))
- (with-output-to-port
- (current-error-port)
- (lambda ()
- (display err)
- (display ": ")
- (display descr))))
+ (apply format (current-error-port) fmt fmtargs))
(defmacro catch-sql (expr)
`(catch 'gsql-error
diff --git a/src/ellinika/dico.scm b/src/ellinika/dico.scm
index 7c04db2..f9a6f63 100644
--- a/src/ellinika/dico.scm
+++ b/src/ellinika/dico.scm
@@ -24,14 +24,8 @@
(ellinika xlat)
(ellinika config))
-(define (sql-error-handler err descr)
- (format #t "cannot connect to the database")
- (with-output-to-port
- (current-error-port)
- (lambda ()
- (display err)
- (display ": ")
- (display descr))))
+(define (sql-error-handler key func fmt fmtargs data)
+ (apply format (current-error-port) fmt fmtargs))
(define (my-sql-query conn query)
(catch #t

Return to:

Send suggestions and report system problems to the System administrator.