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 401a537 commit 24548f8
Showing 1 changed file with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ redirects:

## Syntax [#syntax]

```
```py
newrelic.agent.set_error_group_callback(callback_function(exc))
```

Expand Down Expand Up @@ -113,24 +113,23 @@ When unsuccessful, the API will not add `error.group.name` as an agent attribute

An example of using `set_error_group_callback`:

```
```py
def customer_callback(exc):
if isinstance(exc,ValueError):
return "group1"
if isinstance(exc,ValueError):
return "group1"


def some_other_function():
try:
raise ValueError("Oh no!")
except Exception:
newrelic.agent.notice_error()
try:
raise ValueError("Oh no!")
except Exception:
newrelic.agent.notice_error()


def example_function(customer_callback):
try:
newrelic.agent.set_error_group_callback(customer_callback)
some_other_function()
finally:
newrelic.agent.set_error_group_callback(None)
try:
newrelic.agent.set_error_group_callback(customer_callback)
some_other_function()
finally:
newrelic.agent.set_error_group_callback(None)
```

0 comments on commit 24548f8

Please sign in to comment.