r10253: Automated commit for Debian build of clsql upstream-version-3.1.5
[clsql.git] / sql / time.lisp
index 8d0684658825b56e5ba37a316b36624fbcdb8e46..c5e78a6738bc7d64122b468b653afe690d24ad3f 100644 (file)
@@ -1013,20 +1013,22 @@ rules"
 ;; ------------------------------------------------------------
 ;; Parsing iso-8601 timestrings 
 
-(define-condition iso-8601-syntax-error (error)
+(define-condition iso-8601-syntax-error (sql-user-error)
   ((bad-component;; year, month whatever
     :initarg :bad-component
-    :reader bad-component)))
+    :reader bad-component))
+  (:report (lambda (c stream)
+            (format stream "Bad component: ~A " (bad-component c)))))
 
 (defun parse-timestring (timestring &key (start 0) end junk-allowed)
   "parse a timestring and return the corresponding wall-time.  If the
 timestring starts with P, read a duration; otherwise read an ISO 8601
 formatted date string."
-  (declare (ignore junk-allowed))  ;; FIXME
+  (declare (ignore junk-allowed))  
   (let ((string (subseq timestring start end)))
     (if (char= (aref string 0) #\P)
-        (parse-iso-8601-duration string)
-        (parse-iso-8601-time string))))
+       (parse-iso-8601-duration string)
+      (parse-iso-8601-time string))))
 
 (defvar *iso-8601-duration-delimiters*
   '((#\D . :days)