Clojurescript library with functions aiding in error handling. This library currently utilises timbre as a logging library. You shoud use it in conjunction with the district-server-logging and district-ui-logging modules which setup various logging appenders.
Include [district.shared.error-handling]
in your CLJS file.
try-catch
try-catch-throw
(ns my-district
(:require [district.shared.error-handling :refer [try-catch try-catch-throw]]))
(defn function-that-can-fail [n]
(try-catch
(/ 7 n)))
error-handling
requires a configured district-server-logging
and/or district-ui-logging
modules to function correctly.
Depending on where the code is run and how the logging is configured your errors will be reported to the browser, node.js console, log file, sentry etc.
For possible configuration options please see district-server-logging and district-ui-logging.
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close