Skip to content

Commit

Permalink
Temp commit for testing Sentry exception captures
Browse files Browse the repository at this point in the history
  • Loading branch information
jimchamp committed May 8, 2024
1 parent 8298d5e commit cb16606
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions openlibrary/plugins/upstream/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -1332,3 +1332,23 @@ def get_loan_history_data(page: int, mb: "MyBooksTemplate") -> dict[str, Any]:
'limit': limit,
'page': page,
}


class test_handled_exception_logging(delegate.page):
path = '/_test/handle/exception'

def GET(self):
i = web.input(unhandled=False)
result = ''
if i.unhandled:
1/0

Check failure on line 1344 in openlibrary/plugins/upstream/account.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (B018)

openlibrary/plugins/upstream/account.py:1344:13: B018 Found useless expression. Either assign it to a variable or remove it.
else:
try:
ex = OLAuthenticationError('undefined_error')
ex.creation_ts = datetime.now()
raise ex
except OLAuthenticationError as e:
result = e.creation_ts

return delegate.RawText(result)

0 comments on commit cb16606

Please sign in to comment.