Skip to content

Commit

Permalink
chore: add language identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
brnhensley committed May 29, 2023
1 parent 4e6f155 commit 99c09d9
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -14,7 +14,7 @@ redirects:

## Syntax

```
```py
newrelic.agent.record_exception(exc=None, value=None, tb=None, params={}, ignore_errors=[], application=None)
```

Expand Down Expand Up @@ -136,15 +136,15 @@ None.

In large majority of cases, you won't need to pass any paramters. You would just call the following where you want to report an exception:

```
```py
newrelic.agent.record_exception()
```

### Call with sys.exc_info() tuple and additional parameters [#complex-example]

An example of `record_exception` using `sys.exc_info()` data:

```
```py
def complex_ignore_errors(exc, val, tb):
# do some logic here
return False
Expand All @@ -156,7 +156,7 @@ newrelic.agent.record_exception(params={'my_special_exception': True}, ignore_er

If you need to filter exceptions dynamically based on the attributes of a specific exception type, you can supply a callback function:

```
```py
def _ignore_errors(exc, value, tb):
if instance(value, HTTPError):
if value.status == 404:
Expand Down

0 comments on commit 99c09d9

Please sign in to comment.