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.
(define (load-accounts-list apikeys)
(call/cc
(lambda (ret)
(with-exception-handler
(lambda (ex)
(ret '()))
(lambda ()
(map (compose car string-split)
(read-lines
(open-input-file apikeys))))))))
(handle-exceptions
ex
'()
(map (compose car string-split)
(read-lines
(open-input-file apikeys)))))
;; Loads all accounts - it expects .csv files in given directory.
(define (load-accounts accounts-list dir)