Skip to content

About

Hawk catcher for Clojure

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

hawk.clojure

A Clojure client for the Hawk error catcher.

Installation

Add a git dependency to your deps.edn:

{:deps {io.github.krvital/hawk.clojure {:git/sha "<commit-sha>"}}}

Usage

(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"})

Ring middleware

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))

Development

Run the test suite:

clojure -X:test

Start an nREPL:

clojure -M:nrepl

License

MIT, see LICENSE.

About

Hawk catcher for Clojure

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages