mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 01:13:23 -04:00
[Obs AI Assistant] Capture error thrown in context (#186826)
Closes https://github.com/elastic/kibana/issues/180190

This commit is contained in:
parent
3ab56f5e4e
commit
1eb7a5ee0b
1 changed files with 15 additions and 1 deletions
|
@ -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();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue