Simplify exception handling in account list loader.
This commit is contained in:
parent
f2265de1b7
commit
a22aec695b
1 changed files with 6 additions and 9 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue