aboutsummaryrefslogtreecommitdiff
path: root/module/vcomponent
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-03-07 22:55:14 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-03-07 22:55:35 +0100
commit57e4004ec1a0489e6d8bc7dbd4bd07b110b6239b (patch)
tree119fc86cce7dddc174d71bbc125d9cc4ac0ed40e /module/vcomponent
parentHandle broken symlink when generating static HTML. (diff)
downloadcalp-57e4004ec1a0489e6d8bc7dbd4bd07b110b6239b.tar.gz
calp-57e4004ec1a0489e6d8bc7dbd4bd07b110b6239b.tar.xz
Replace Guile's srfi-64:s test-error with working version.
Along with updating now failing tests.
Diffstat (limited to 'module/vcomponent')
-rw-r--r--module/vcomponent/recurrence/parse.scm10
1 files changed, 8 insertions, 2 deletions
diff --git a/module/vcomponent/recurrence/parse.scm b/module/vcomponent/recurrence/parse.scm
index 3477f6d4..c2e3a10f 100644
--- a/module/vcomponent/recurrence/parse.scm
+++ b/module/vcomponent/recurrence/parse.scm
@@ -72,6 +72,12 @@
`(else ,@body)))
cases))))
+(define* (string->number/throw string optional: (radix 10))
+ (or (string->number string radix)
+ (scm-error 'wrong-type-argument
+ "string->number/throw"
+ "Can't parse ~s as number in base ~a"
+ '(string radix) #f)))
;; 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
@@ -92,8 +98,8 @@
(parse-ics-datetime val)))
(day (rfc->datetime-weekday (string->symbol val)))
(days (map parse-day-spec (string-split val #\,)))
- (num (string->number val))
- (nums (map string->number (string-split val #\,))))
+ (num (string->number/throw val))
+ (nums (map string->number/throw (string-split val #\,))))
;; It's an error to give BYHOUR and smaller for pure dates.
;; 3.3.10. p 41