Skip to content

Commit c0b8d86

Browse files
committed
simplify project
1 parent 5b6602f commit c0b8d86

File tree

5 files changed

+46
-16
lines changed

5 files changed

+46
-16
lines changed

README.adoc

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
= sentry-tiny
22

33
A Clojure library designed to cover basic needs of pushing exceptions into Sentry.
4-
Not more, but not less
4+
We should prize every moment, isn't it?
55

66
image:https://img.shields.io/clojars/v/net.tbt-post/sentry-tiny.svg[]
77

@@ -11,9 +11,37 @@ Add the following to your http://github.com/technomancy/leiningen[Leiningen's] `
1111

1212
[source,clojure]
1313
----
14-
[net.tbt-post/sentry-tiny "0.1.5"]
14+
[net.tbt-post/sentry-tiny "0.1.6"]
1515
----
1616

17+
and just use it to catch your exception:
18+
19+
[source,clojure]
20+
----
21+
(require '[sentry-tiny.core :as stc])
22+
23+
(def dsn "http://<digest>@<sentry>/<id>")
24+
25+
(defn catch [ns _ _ ^Throwable e]
26+
(-> dsn
27+
stc/parse-dsn
28+
(stc/capture (stc/e->evi [(str ns)] e))))
29+
----
30+
31+
or to just send a message
32+
33+
[source,clojure]
34+
----
35+
(defn message [msg]
36+
(-> dsn
37+
stc/parse-dsn
38+
(stc/capture
39+
(stc/e->evi [(str *ns*)]
40+
(RuntimeException. msg)))))
41+
----
42+
43+
You may eventually use it as a replacement inside of your web app router.
44+
1745
== Manual Build
1846

1947
[source,text]

profiles.clj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{:dev {:plugins [[lein-ancient "0.6.15"]]
2+
:deploy-repositories [["private-jars" "http://10.10.3.4:9180/repo"]]}
3+
:provided {:dependencies [[org.clojure/clojure "1.9.0"]]}
4+
:uberjar {:aot :all :jvm-opts #=(eval
5+
(concat ["-Xmx1G"]
6+
(let [version (System/getProperty "java.version")
7+
[major _ _] (clojure.string/split version #"\.")]
8+
(if (>= (Integer. major) 9)
9+
["--add-modules" "java.xml.bind"]
10+
[]))))}}

project.clj

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33
:url "https://github.com/source-c/sentry-tiny"
44
:license {:name "Eclipse Public License"
55
:url "http://www.eclipse.org/legal/epl-v10.html"}
6-
:dependencies [[org.clojure/clojure "1.9.0"]
7-
[cheshire "5.8.0"]
6+
:dependencies [[cheshire "5.8.0"]
87
[http-kit "2.2.0"]
9-
[clj-time "0.14.2"]
10-
[danlentz/clj-uuid "0.1.7"]]
11-
:plugins [[lein-ancient "0.6.15"]]
12-
:profiles {:uberjar {:aot :all :jvm-opts ~(let [version (System/getProperty "java.version")
13-
[major _ _] (clojure.string/split version #"\.")]
14-
(if (>= (Integer. major) 9) ;; FIXME: drop this tricky hack/hacky trick
15-
["--add-modules" "java.xml.bind"]
16-
[]))}})
8+
[clj-time "0.14.2"]])

resources/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.5
1+
0.1.6

src/sentry_tiny/core.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
[clojure.java.io :as io]
55
[org.httpkit.client :as http]
66
[cheshire.core :as json]
7-
[clj-uuid :as uuid]
87
[clj-time
98
[core :as t]
109
[format :as ft]])
1110
(:import
12-
(java.net InetAddress)))
11+
(java.net InetAddress)
12+
(java.util UUID)))
1313

1414
(defonce ^:private fallback (atom {:enabled? false}))
1515

@@ -49,7 +49,7 @@
4949
:value (.getMessage e)}]))
5050

5151
(defn- generate-uuid []
52-
(str/replace (uuid/v4) #"-" ""))
52+
(str/replace (UUID/randomUUID) #"-" ""))
5353

5454
(defn- make-sentry-url [uri project-id]
5555
(format "%s/api/%s/store/" uri project-id))

0 commit comments

Comments
 (0)