Simplify exception handling in account list loader.

This commit is contained in:
Dominik Pantůček 2023-06-23 22:56:53 +02:00
parent f2265de1b7
commit a22aec695b

View file

@ -120,15 +120,12 @@
;; Reads the accounts list, returns '() upon error. ;; Reads the accounts list, returns '() upon error.
(define (load-accounts-list apikeys) (define (load-accounts-list apikeys)
(call/cc (handle-exceptions
(lambda (ret) ex
(with-exception-handler '()
(lambda (ex) (map (compose car string-split)
(ret '())) (read-lines
(lambda () (open-input-file apikeys)))))
(map (compose car string-split)
(read-lines
(open-input-file apikeys))))))))
;; Loads all accounts - it expects .csv files in given directory. ;; Loads all accounts - it expects .csv files in given directory.
(define (load-accounts accounts-list dir) (define (load-accounts accounts-list dir)