Skip to content

Commit 3bbb1f2

Browse files
committed
chore: sentry refactor
1 parent 1d5ede4 commit 3bbb1f2

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

docs/utilities/batch.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -387,15 +387,6 @@ When using Sentry.io for error monitoring, you can override `failure_handler` to
387387

388388
> Credits to [Charles-Axel Dein](https://github.com/awslabs/aws-lambda-powertools-python/issues/293#issuecomment-781961732)
389389
390-
```python hl_lines="4 7-8" title="Integrating error tracking with Sentry.io"
391-
from typing import Tuple
392-
393-
from aws_lambda_powertools.utilities.batch import BatchProcessor, FailureResponse
394-
from sentry_sdk import capture_exception
395-
396-
397-
class MyProcessor(BatchProcessor):
398-
def failure_handler(self, record, exception) -> FailureResponse:
399-
capture_exception() # send exception to Sentry
400-
return super().failure_handler(record, exception)
390+
```python hl_lines="1 7-8" title="Integrating error tracking with Sentry.io"
391+
--8<-- "examples/batch_processing/src/sentry_error_tracking.py"
401392
```
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from sentry_sdk import capture_exception
2+
3+
from aws_lambda_powertools.utilities.batch import BatchProcessor, FailureResponse
4+
5+
6+
class MyProcessor(BatchProcessor):
7+
def failure_handler(self, record, exception) -> FailureResponse:
8+
capture_exception() # send exception to Sentry
9+
return super().failure_handler(record, exception)

0 commit comments

Comments
 (0)