Skip to content
This repository has been archived by the owner on May 1, 2021. It is now read-only.

Commit

Permalink
Added url to static generator error message
Browse files Browse the repository at this point in the history
  • Loading branch information
heynemann committed Oct 27, 2009
1 parent 32df472 commit f76e5be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions staticgenerator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@ def get_content_from_path(self, path):
try:
response = handler(request)
except Exception, err:
raise StaticGeneratorException("The requested page raised an exception. Static Generation failed. Error: %s" % str(err))
raise StaticGeneratorException("The requested page(\"%s\") raised an exception. Static Generation failed. Error: %s" % (path, str(err)))

if int(response.status_code) != 200:
raise StaticGeneratorException("The requested page returned http code %d. Static Generation failed." % int(response.status_code))
raise StaticGeneratorException("The requested page(\"%s\") returned http code %d. Static Generation failed." % (path, int(response.status_code)))

return response.content

Expand Down
6 changes: 3 additions & 3 deletions staticgenerator/tests/unit/test_staticgenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ def test_bad_request_raises_proper_exception():

result = instance.get_content_from_path(path_mock)
except StaticGeneratorException, e:
assert str(e) == 'The requested page returned http code 500. Static Generation failed.'
assert str(e) == 'The requested page("some_path") returned http code 500. Static Generation failed.'
mox.VerifyAll()
return
finally:
Expand Down Expand Up @@ -696,7 +696,7 @@ def test_not_found_raises_proper_exception():

result = instance.get_content_from_path(path_mock)
except StaticGeneratorException, e:
assert str(e) == 'The requested page returned http code 404. Static Generation failed.'
assert str(e) == 'The requested page("some_path") returned http code 404. Static Generation failed.'
mox.VerifyAll()
return
finally:
Expand Down Expand Up @@ -738,7 +738,7 @@ def test_request_exception_raises_proper_exception():

result = instance.get_content_from_path(path_mock)
except StaticGeneratorException, e:
assert str(e) == 'The requested page raised an exception. Static Generation failed. Error: exception'
assert str(e) == 'The requested page("some_path") raised an exception. Static Generation failed. Error: exception'
mox.VerifyAll()
return
finally:
Expand Down

0 comments on commit f76e5be

Please sign in to comment.