Skip to content

Commit f37967b

Browse files
Better hash format error message (#1442)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent a6d2d35 commit f37967b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

jupyter_server/services/contents/handlers.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ async def get(self, path=""):
140140

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

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

0 commit comments

Comments
 (0)