Raise from None

See https://www.bugsink.com/blog/using-raise-from-none-in-python/
in this case: PermissionDenied so clearly implies 'not found in db' that
the details of not finding are truly immaterial
This commit is contained in:
Klaas van Schelven
2025-01-29 09:09:05 +01:00
parent 59372aba33
commit 452ac806b7

View File

@@ -93,7 +93,7 @@ class BaseIngestAPIView(View):
# you want to show as a first step towards debugging issues with SDKs with faulty authentication (a rather
# common scenario).
dsn = build_dsn(str(get_settings().BASE_URL), project_pk, sentry_key)
raise exceptions.PermissionDenied("Project not found or key incorrect: %s" % dsn)
raise exceptions.PermissionDenied("Project not found or key incorrect: %s" % dsn) from None
@classmethod
def get_project_for_request(cls, project_pk, request):