diff options
Diffstat (limited to 'readers')
-rw-r--r-- | readers/article.rkt | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/readers/article.rkt b/readers/article.rkt index df5e8e8..c60de16 100644 --- a/readers/article.rkt +++ b/readers/article.rkt @@ -3,7 +3,8 @@ (provide read-article) (require "../entities/article.rkt") -(require (only-in typed/srfi/19 string->date)) +(require (only-in "../utils/date.rkt" string->date)) + (require typed/json) (require typed/syntax/readerr) @@ -19,9 +20,9 @@ (define timestamp (let ([timestamp (hash-ref jse 'timestamp (thunk (k "timestamp not found")))]) (unless (string? timestamp) (k "timestamp must be a string")) - (with-handlers ([exn:fail? (const #f)]) + (with-handlers ([exn:fail? (lambda (_e) + (k "timestamp must be a iso8600 string"))]) (string->date timestamp "~Y-~m-~dT~H:~M:~S~z")))) - (unless (date? timestamp) (k "timestamp must be a iso8600 string")) (define hash (hash-ref jse 'hash (thunk (k "hash not found")))) (unless (string? hash) (k "hash must be a string")) |