From 574c9ddbf0c922cee4530c21633b77d0857ead01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Wed, 22 Apr 2020 21:27:13 +0200 Subject: Improve error reporting on recurrence parse. --- module/vcomponent/recurrence/parse.scm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/module/vcomponent/recurrence/parse.scm b/module/vcomponent/recurrence/parse.scm index b044aae1..a4f86942 100644 --- a/module/vcomponent/recurrence/parse.scm +++ b/module/vcomponent/recurrence/parse.scm @@ -53,7 +53,9 @@ ((key guard '=> body ...) `((,key) (if (not ,guard) (begin (warning (quote ,key) - (quote ,guard)) + (quote ,guard) + (list ,@guard) + ) ,@else-clause) (begin ,@body)))) ((key body ...) @@ -62,11 +64,14 @@ `(else ,@body))) cases)))) -(define (warning key guard ) - (display (format #f "Warning RRULE guard failed for key ~a~% guard: ~a~%" - key guard) +(define (warning key guard extra) + (display (format #f "Warning RRULE guard failed for key ~a~% guard: ~a : ~s~%" + key guard (map (lambda (o) (if (procedure? o) + (procedure-name o) + o)) extra)) (current-error-port))) + ;; RFC 5545, Section 3.3.10. Recurrence Rule, states that the UNTIL value MUST have ;; the same type as the DTSTART of the event (date or datetime). I have seen events ;; in the wild which didn't follow this. I consider that an user error. -- cgit v1.2.3