refactor: Replace println with log calls for better error handling
This commit is contained in:
@@ -24,8 +24,7 @@
|
|||||||
(try [true (f)]
|
(try [true (f)]
|
||||||
(catch RuntimeException e
|
(catch RuntimeException e
|
||||||
(do (when verbose
|
(do (when verbose
|
||||||
(println (format "exception: %s"
|
(log/error e "exception"))
|
||||||
(.toString e))))
|
|
||||||
[false e]))))
|
[false e]))))
|
||||||
max-wait (* 5 60 1000)] ;; wait at most 5 minutes
|
max-wait (* 5 60 1000)] ;; wait at most 5 minutes
|
||||||
(loop [[success? result] (wrapped-attempt)
|
(loop [[success? result] (wrapped-attempt)
|
||||||
@@ -33,7 +32,7 @@
|
|||||||
(if success?
|
(if success?
|
||||||
result
|
result
|
||||||
(do (when verbose
|
(do (when verbose
|
||||||
(println (format "attempt failed, attempting reconnect")))
|
(log/warn "attempt failed, attempting reconnect"))
|
||||||
(reconnect)
|
(reconnect)
|
||||||
(when verbose
|
(when verbose
|
||||||
(log/debug (format "sleeping %s ms" wait-ms)))
|
(log/debug (format "sleeping %s ms" wait-ms)))
|
||||||
|
|||||||
Reference in New Issue
Block a user