* mua updates

This commit is contained in:
Dirk-Jan C. Binnema
2011-08-29 23:39:25 +03:00
parent ff7a40b3d9
commit 3692fc1b39
4 changed files with 146 additions and 218 deletions

View File

@ -141,67 +141,4 @@ them."
(mua/mu-db-update-execute))
;; generated with:
;; cat mu-util.h | sed 's/\([A-Z_]\+\).*=\(.*\),/(defconst \L\1 \2)/' < "$<" \
;; | sed 's/_/-/g' > mu-errors.el
(defconst mu-error 1)
(defconst mu-error-in-parameters 2)
(defconst mu-error-internal 3)
(defconst mu-error-no-matches 4)
(defconst mu-error-xapian 11)
(defconst mu-error-xapian-query 13)
(defconst mu-error-xapian-dir-not-accessible 14)
(defconst mu-error-xapian-not-up-to-date 15)
(defconst mu-error-xapian-missing-data 16)
(defconst mu-error-xapian-corruption 17)
(defconst mu-error-xapian-cannot-get-writelock 18)
(defconst mu-error-gmime 30)
(defconst mu-error-contacts 50)
(defconst mu-error-contacts-cannot-retrieve 51)
(defconst mu-error-file 70)
(defconst mu-error-file-invalid-name 71)
(defconst mu-error-file-cannot-link 72)
(defconst mu-error-file-cannot-open 73)
(defconst mu-error-file-cannot-read 74)
(defconst mu-error-file-cannot-create 75)
(defconst mu-error-file-cannot-mkdir 76)
(defconst mu-error-file-stat-failed 77)
(defconst mu-error-file-readdir-failed 78)
(defconst mu-error-file-invalid-source 79)
(defconst mu-error-file-target-equals-source 80)
(defun mua/mu-error (err)
"Convert an exit code from mu into a string."
(cond
((eql err mu-error) "General error")
((eql err mu-error-in-parameters) "Error in parameters")
((eql err mu-error-internal) "Internal error")
((eql err mu-error-no-matches) "No matches")
((eql err mu-error-xapian) "Xapian error")
((eql err mu-error-xapian-query) "Error in query")
((eql err mu-error-xapian-dir-not-accessible) "Database dir not accessible")
((eql err mu-error-xapian-not-up-to-date) "Database is not up-to-date")
((eql err mu-error-xapian-missing-data) "Missing data")
((eql err mu-error-xapian-corruption) "Database seems to be corrupted")
((eql err mu-error-xapian-cannot-get-writelock) "Database is locked")
((eql err mu-error-gmime) "GMime-related error")
((eql err mu-error-contacts) "Contacts-related error")
((eql err mu-error-contacts-cannot-retrieve) "Failed to retrieve contacts")
((eql err mu-error-file) "File error")
((eql err mu-error-file-invalid-name) "Invalid file name")
((eql err mu-error-file-cannot-link) "Failed to link file")
((eql err mu-error-file-cannot-open) "Cannot open file")
((eql err mu-error-file-cannot-read) "Cannot read file")
((eql err mu-error-file-cannot-create) "Cannot create file")
((eql err mu-error-file-cannot-mkdir) "mu-mkdir failed")
((eql err mu-error-file-stat-failed) "stat(2) failed")
((eql err mu-error-file-readdir-failed) "readdir failed")
((eql err mu-error-file-invalid-source) "Invalid source file")
((eql err mu-error-file-target-equals-source) "Source is same as target")
(t (format "Unknown error (%d)" err))))
(provide 'mua-mu)