added some error checking
svn: r4213
This commit is contained in:
parent
234ac6173c
commit
cb3989677e
|
@ -145,9 +145,19 @@
|
||||||
;; mailboxes holds the list of messages reflected in the top list
|
;; mailboxes holds the list of messages reflected in the top list
|
||||||
;; in the GUI. When modifying this value (usually indirectly), use
|
;; in the GUI. When modifying this value (usually indirectly), use
|
||||||
;; `header-chganging-action'. Mutate the variable, but not the list!
|
;; `header-chganging-action'. Mutate the variable, but not the list!
|
||||||
(define mailbox (let ([l (with-handlers ([void (lambda (x) null)])
|
(define mailbox (let* ([mailbox-file (build-path mailbox-dir "mailbox")]
|
||||||
(with-input-from-file (build-path mailbox-dir "mailbox")
|
[l (with-handlers ([void (lambda (x)
|
||||||
read))])
|
(message-box "SirMail"
|
||||||
|
(format
|
||||||
|
"error reading mailbox ~s, ~a\n"
|
||||||
|
mailbox-file
|
||||||
|
(exn-message x)))
|
||||||
|
null)])
|
||||||
|
(with-input-from-file mailbox-file
|
||||||
|
read))])
|
||||||
|
(when (eof-object? l)
|
||||||
|
(message-box "SirMail" (format "mailbox ~s was eof\n" mailbox-file))
|
||||||
|
(set! l '()))
|
||||||
;; If the file's list start with an integer, that's
|
;; If the file's list start with an integer, that's
|
||||||
;; the uidvalidity value. Otherwise, for backward
|
;; the uidvalidity value. Otherwise, for backward
|
||||||
;; compatibility, we allow the case that it wasn't
|
;; compatibility, we allow the case that it wasn't
|
||||||
|
|
Loading…
Reference in New Issue
Block a user