Skip to content

Commit

Permalink
Add details to exception to see where we're going wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
tw4l committed Nov 5, 2024
1 parent a5a5d1c commit 27cf0e7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pywb/apps/static_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ def __call__(self, environ, url_str):
try:
validate_requested_file_path(static_path_to_validate, url)
except ValueError:
raise NotFoundException('Static File Not Found: ' +
url_str)
raise NotFoundException(f'Static File {url_str} (simplified: {url}) not found in {static_path_to_validate}')

try:
data = self.block_loader.load(full_path)
Expand Down Expand Up @@ -81,7 +80,7 @@ def __call__(self, environ, url_str):
url_str)

def validate_requested_file_path(self, static_dir, requested_path):
"""Validate that requested file path is within static dir.
"""Validate that requested relative file path is within static dir.
Returns relative path starting from static_dir or raises ValueError if
requested path is not in the static directory.
Expand Down

0 comments on commit 27cf0e7

Please sign in to comment.