Skip to content

Commit 2a40ca1

Browse files
colin-sentryarjenzorgdoc
authored andcommitted
If there is an internal error, still return a value (getsentry#3192)
There might be cases where there is an internal error and the function would return None
1 parent 27d68c4 commit 2a40ca1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sentry_sdk/integrations/openai.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def _calculate_chat_completion_usage(
121121

122122
def _wrap_chat_completion_create(f):
123123
# type: (Callable[..., Any]) -> Callable[..., Any]
124-
@wraps(f)
124+
125125
@ensure_integration_enabled(OpenAIIntegration, f)
126126
def new_chat_completion(*args, **kwargs):
127127
# type: (*Any, **Any) -> Any
@@ -211,7 +211,7 @@ def new_iterator():
211211
else:
212212
set_data_normalized(span, "unknown_response", True)
213213
span.__exit__(None, None, None)
214-
return res
214+
return res
215215

216216
return new_chat_completion
217217

0 commit comments

Comments
 (0)