QIF Import: Throw an error immediately upon failing to parse a category. Previously a bad value was returned, which could then cause a failure in the caller.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18000 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Charles Day 2009-03-25 00:52:32 +00:00
parent 77c174f5c0
commit 908813cf34

View File

@ -64,8 +64,13 @@
#f)))) #f))))
rv) rv)
(begin (begin
;; Parsing failed. Bug detected!
(gnc:warn "qif-split:parse-category: can't parse [" value "].") (gnc:warn "qif-split:parse-category: can't parse [" value "].")
(list "" #f #f))))) (throw 'bug
"qif-split:parse-category"
"Can't parse account or category ~A."
(list value)
#f)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -457,8 +462,7 @@
(lambda () (read)))) (lambda () (read))))
date-parts)) date-parts))
;; if the date parts list doesn't have 3 parts, we're in ;; if the date parts list doesn't have 3 parts, we're in trouble
;; trouble
(if (not (eq? 3 (length date-parts))) (if (not (eq? 3 (length date-parts)))
(gnc:warn "qif-parse:parse-date/format: can't interpret date [" (gnc:warn "qif-parse:parse-date/format: can't interpret date ["
date-string "]\nDate parts: " date-parts) date-string "]\nDate parts: " date-parts)