r18000 - gnucash/trunk/src/import-export/qif-import - 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.

Charles Day cedayiv at cvs.gnucash.org
Tue Mar 24 20:52:32 EDT 2009


Author: cedayiv
Date: 2009-03-24 20:52:32 -0400 (Tue, 24 Mar 2009)
New Revision: 18000
Trac: http://svn.gnucash.org/trac/changeset/18000

Modified:
   gnucash/trunk/src/import-export/qif-import/qif-parse.scm
Log:
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.


Modified: gnucash/trunk/src/import-export/qif-import/qif-parse.scm
===================================================================
--- gnucash/trunk/src/import-export/qif-import/qif-parse.scm	2009-03-22 17:48:34 UTC (rev 17999)
+++ gnucash/trunk/src/import-export/qif-import/qif-parse.scm	2009-03-25 00:52:32 UTC (rev 18000)
@@ -64,8 +64,13 @@
                          #f))))
           rv)
         (begin
+          ;; Parsing failed. Bug detected!
           (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))))
                date-parts))
 
-    ;; if the date parts list doesn't have 3 parts, we're in
-    ;; trouble
+    ;; if the date parts list doesn't have 3 parts, we're in trouble
     (if (not (eq? 3 (length date-parts)))
         (gnc:warn "qif-parse:parse-date/format: can't interpret date ["
                   date-string "]\nDate parts: " date-parts)



More information about the gnucash-changes mailing list