Skip to content

Commit

Permalink
Better hash format error message (#1442)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
fcollonval and pre-commit-ci[bot] authored Jul 18, 2024
1 parent a6d2d35 commit f37967b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion jupyter_server/services/contents/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ async def get(self, path=""):

hash_str = self.get_query_argument("hash", default="0")
if hash_str not in {"0", "1"}:
raise web.HTTPError(400, f"Content {hash_str!r} is invalid")
raise web.HTTPError(
400, f"Hash argument {hash_str!r} is invalid. It must be '0' or '1'."
)
require_hash = int(hash_str)

if not cm.allow_hidden and await ensure_async(cm.is_hidden(path)):
Expand Down

0 comments on commit f37967b

Please sign in to comment.