A Clojure client for the Hawk error catcher.
Add a git dependency to your deps.edn:
{:deps {io.github.krvital/hawk.clojure {:git/sha "<commit-sha>"}}}(require '[hawk.core :as hawk])
(def client (hawk/make-client "put token here"))
(try
(/ 1 0)
(catch Exception e
(hawk/send! client e)))send! also accepts optional context and user maps:
(hawk/send! client e {:some "context"} {:id "42" :name "Jane"})hawk.middleware/wrap-hawk catches exceptions raised by a Ring handler, reports them to Hawk,
and re-raises them:
(require '[hawk.middleware :as hawk.middleware])
(def app
(hawk.middleware/wrap-hawk handler client))Run the test suite:
clojure -X:testStart an nREPL:
clojure -M:nreplMIT, see LICENSE.