Skip to content

Commit 50c6cc2

Browse files
committed
Tighten search page error handling
If a user sends `page[]=1` as a param, we'll get a Vector here, which will cause a ClassCastException instead of a NumberFormatException. So we'll just catch any exception here and return an error response instead of triggering a 500.
1 parent 4a109fd commit 50c6cc2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/clojars/web.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
[maybe-page]
3939
(try
4040
(Integer/parseInt maybe-page)
41-
(catch NumberFormatException _nfe
41+
(catch Exception _
4242
(throw (ex-info
4343
"page must be an integer"
4444
{:report? false

0 commit comments

Comments
 (0)