Skip to content

Commit d3a7cff

Browse files
committed
Remove /error route
This was just used in tests to ensure error reporting worked, but external callers hit it sometimes, leading to noise in Sentry.
1 parent c061d2b commit d3a7cff

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

src/clojars/web.clj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@
8484
(verify/routes db event-emitter)
8585
(token/routes db)
8686
(api/routes db stats)
87-
(GET "/error" _ (throw (Exception. "What!? You really want an error?")))
8887
(PUT "*" _ {:status 405 :headers {} :body "Did you mean to use /repo?"})
8988
(ANY "*" _
9089
(try-account

test/clojars/integration/web_test.clj

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
[clojars.errors :as errors]
55
[clojars.log :as log]
66
[clojars.test-helper :as help]
7+
[clojars.web.dashboard :as dashboard]
78
[clojure.test :refer [deftest is use-fixtures]]
89
[kerodon.core :refer [fill-in follow-redirect follow press
910
session visit within]]
@@ -16,24 +17,22 @@
1617
help/run-test-app)
1718

1819
(deftest server-errors-display-error-page
19-
(with-out-str (-> (session (help/app))
20-
(visit "/error")
21-
(within [:div.small-section :> :h1]
22-
(has (text? "Oops!"))))))
23-
24-
(deftest error-page-includes-error-id
25-
(with-redefs [log/trace-id (constantly #uuid "8f3788f5-9001-444d-8c57-049ba685cea8")]
20+
(with-redefs [dashboard/index-page (fn [& _] (throw (Exception. "BOOM!")))
21+
log/trace-id (constantly #uuid "8f3788f5-9001-444d-8c57-049ba685cea8")]
2622
(with-out-str (-> (session (help/app))
27-
(visit "/error")
23+
(visit "/")
24+
(within [:div.small-section :> :h1]
25+
(has (text? "Oops!")))
2826
(within [:div.small-section :> :pre.error-id]
2927
(has (text? "error-id:\"8f3788f5-9001-444d-8c57-049ba685cea8\"")))))))
3028

3129
(deftest server-errors-log-caught-exceptions
3230
(let [err (atom nil)]
33-
(with-redefs [errors/report-error (fn [_r e & _] (reset! err e))]
31+
(with-redefs [dashboard/index-page (fn [& _] (throw (Exception. "BOOM!")))
32+
errors/report-error (fn [_r e & _] (reset! err e))]
3433
(-> (session (help/app))
35-
(visit "/error"))
36-
(is (re-find #"You really want an error" (.getMessage @err))))))
34+
(visit "/"))
35+
(is (re-find #"BOOM" (.getMessage @err))))))
3736

3837
(deftest browse-page-renders-multiple-pages
3938
(help/add-verified-group "test-user" "tester")

0 commit comments

Comments
 (0)