Skip to content

Commit

Permalink
[Obs AI Assistant] Capture error thrown in context (#186826)
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenlouv authored and pull[bot] committed Jul 31, 2024
1 parent 6364205 commit fca6cdd
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,21 @@ export function registerContextFunction({
subscriber.complete();
})
.catch((error) => {
subscriber.error(error);
resources.logger.error('Error in context function');
resources.logger.error(error);

subscriber.next(
createFunctionResponseMessage({
name: CONTEXT_FUNCTION_NAME,
content: `Error in context function: ${error.message}`,
data: {
error: {
message: error.message,
},
},
})
);
subscriber.complete();
});
});
}
Expand Down

0 comments on commit fca6cdd

Please sign in to comment.