chore: enable ruff lint rule TRY201 and B904 to improve raise stack traces (#29166)

This commit is contained in:
Maxime Beauchemin
2024-06-12 13:04:42 -07:00
committed by GitHub
parent 5167d20f27
commit 4bb2e2f8af
50 changed files with 152 additions and 141 deletions

View File

@@ -123,8 +123,8 @@ def make_url_safe(raw_url: str | URL) -> URL:
url = raw_url.strip()
try:
return make_url(url) # noqa
except Exception:
raise DatabaseInvalidError() # pylint: disable=raise-missing-from
except Exception as ex:
raise DatabaseInvalidError() from ex
else:
return raw_url