Skip to content

Commit

Permalink
Tighten search page error handling
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tobias committed Apr 11, 2024
1 parent 4a109fd commit 50c6cc2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/clojars/web.clj
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
[maybe-page]
(try
(Integer/parseInt maybe-page)
(catch NumberFormatException _nfe
(catch Exception _
(throw (ex-info
"page must be an integer"
{:report? false
Expand Down

0 comments on commit 50c6cc2

Please sign in to comment.