diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-03-17 22:14:18 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-03-28 14:17:01 +0200 |
commit | 1da5a277188a954d881316cb605962ee66053285 (patch) | |
tree | 4f77be46498f321d08bfaa072636e4fd252b4f9d /module/datetime.scm | |
parent | Unsmarted define-config% (diff) | |
download | calp-1da5a277188a954d881316cb605962ee66053285.tar.gz calp-1da5a277188a954d881316cb605962ee66053285.tar.xz |
Normalize errors.
Diffstat (limited to '')
-rw-r--r-- | module/datetime.scm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/module/datetime.scm b/module/datetime.scm index 75cffdab..8cffb755 100644 --- a/module/datetime.scm +++ b/module/datetime.scm @@ -735,11 +735,15 @@ Returns -1 on failure" (let* ((head post (cond ((null? (cddr fmt)) (values str '())) ((eqv? #\~ (caddr fmt)) (cond ((null? (cdddr fmt)) - (error "Unexpected ~ at end of fmt")) + (scm-error 'misc-error "string->datetime" + "Unexpected ~ at end of fmt" + #f #f)) ((eqv? #\~ (cadddr fmt)) (span (lambda (c) (not (eqv? #\~ c))) str)) - (else (error "Can't have format specifier directly after month by name")))) + (else (scm-error 'misc-error "string->datetime" + "Can't have format specifier directly after month by name" + #f #f)))) (else (span (lambda (c) (not (eqv? c (caddr fmt)))) str))))) (loop post |