Skip to content

Commit 0a4360d

Browse files
authored
Merge pull request #30 from G4brym/better-app-errors
Add better error handling while app is still starting
2 parents 0863bcb + 654ec59 commit 0a4360d

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

django_cf/__init__.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,15 @@ def start_response(status_str, response_headers):
5050
status = status_str
5151
headers = response_headers
5252

53-
resp = app(wsgi_request, start_response)
53+
try:
54+
resp = app(wsgi_request, start_response)
55+
except Exception as exc:
56+
# library should always print or console log the exception, because a production django should not show end users errors
57+
print('Caught exception while loading application:', exc.__str__())
58+
print(exc)
59+
60+
raise exc
61+
5462
status = resp.status_code
5563
headers = resp.headers
5664

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "django-cf"
7-
version = "0.2.8"
7+
version = "0.2.9"
88
authors = [
99
{ name="Gabriel Massadas" },
1010
]

templates/d1/uv.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

templates/durable-objects/uv.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)