Skip to content

Commit d73f9ee

Browse files
[Obs AI Assistant] replace EuiErrorBoundary with KibanaErrorBoundary (elastic#229710)
Replaces `EuiErrorBoundary` with using `core.rendering.addContext()`. https://github.com/elastic/kibana/blob/main/src/core/packages/rendering/browser/README.mdx I tested this by throwing an error in the feedback buttons and the AI Assistant button itself and confirmed they are caught by the `KibanaErrorBoundary`. --------- Co-authored-by: kibanamachine <[email protected]>
1 parent 261b2df commit d73f9ee

File tree

1 file changed

+16
-19
lines changed
  • x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/utils

1 file changed

+16
-19
lines changed

x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/utils/shared_providers.tsx

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
* 2.0; you may not use this file except in compliance with the Elastic License
55
* 2.0.
66
*/
7-
import { EuiErrorBoundary } from '@elastic/eui';
87
import type { CoreStart, CoreTheme } from '@kbn/core/public';
98
import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
109
import { KibanaThemeProvider } from '@kbn/react-kibana-context-theme';
@@ -31,23 +30,21 @@ export function SharedProviders({
3130
return { theme$ };
3231
}, [theme$]);
3332

34-
return (
35-
<EuiErrorBoundary>
36-
<KibanaThemeProvider theme={theme}>
37-
<KibanaContextProvider
38-
services={{
39-
...coreStart,
40-
...pluginsStart,
41-
plugins: {
42-
start: pluginsStart,
43-
},
44-
}}
45-
>
46-
<RedirectAppLinks coreStart={coreStart}>
47-
<coreStart.i18n.Context>{children}</coreStart.i18n.Context>
48-
</RedirectAppLinks>
49-
</KibanaContextProvider>
50-
</KibanaThemeProvider>
51-
</EuiErrorBoundary>
33+
return coreStart.rendering.addContext(
34+
<KibanaThemeProvider theme={theme}>
35+
<KibanaContextProvider
36+
services={{
37+
...coreStart,
38+
...pluginsStart,
39+
plugins: {
40+
start: pluginsStart,
41+
},
42+
}}
43+
>
44+
<RedirectAppLinks coreStart={coreStart}>
45+
<coreStart.i18n.Context>{children}</coreStart.i18n.Context>
46+
</RedirectAppLinks>
47+
</KibanaContextProvider>
48+
</KibanaThemeProvider>
5249
);
5350
}

0 commit comments

Comments
 (0)