diff options
author | Andy Wingo | 2012-02-11 18:38:21 +0100 |
---|---|---|
committer | Andy Wingo | 2012-02-11 18:38:21 +0100 |
commit | f89e4b128ba83415e045daf500303d24fbcb0083 (patch) | |
tree | 667ad96c7ec48c76a65ddf13b2f37c79756696d4 | |
parent | 7a1944b2400e418daebc3c8d16349e934c4f171d (diff) | |
download | tekuti-f89e4b128ba83415e045daf500303d24fbcb0083.tar.gz tekuti-f89e4b128ba83415e045daf500303d24fbcb0083.zip |
better errors when reindexing
* tekuti/index.scm (maybe-reindex): Reindex within a
call-with-error-handling.
-rw-r--r-- | tekuti/index.scm | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tekuti/index.scm b/tekuti/index.scm index da23423..37c1eb2 100644 --- a/tekuti/index.scm +++ b/tekuti/index.scm @@ -1,5 +1,5 @@ ;; Tekuti -;; Copyright (C) 2008, 2010 Andy Wingo <wingo at pobox dot com> +;; Copyright (C) 2008, 2010, 2012 Andy Wingo <wingo at pobox dot com> ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU General Public License as @@ -26,6 +26,7 @@ (define-module (tekuti index) #:use-module ((srfi srfi-1) #:select (fold)) + #:use-module (system repl error-handling) #:use-module (tekuti util) #:use-module (tekuti git) #:use-module (tekuti post) @@ -93,15 +94,14 @@ (let ((master (git-rev-parse "refs/heads/master"))) (if (equal? (assq-ref old-index 'master) master) old-index - (catch #t - (lambda () - (let ((new-index (reindex old-index master))) - (acons - 'index (write-index new-index (assq-ref old-index 'index)) - new-index))) - (lambda (key . args) - (warn "error while reindexing:" key args) - old-index))))) + (call-with-error-handling + (lambda () + (let ((new-index (reindex old-index master))) + (acons + 'index (write-index new-index (assq-ref old-index 'index)) + new-index))) + #:on-error 'backtrace + #:post-error (lambda _ old-index))))) (define (update-index index key update) (cond |