Skip to content

Commit

Permalink
Make embeddable example plugin not fail for read-only user (elastic#1…
Browse files Browse the repository at this point in the history
…25459)

* wrap write operation in try-catch block

* add space
  • Loading branch information
vadimkibana authored Feb 14, 2022
1 parent 759f87b commit 8f4de1b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/embeddable_explorer/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ export class EmbeddableExplorerPlugin implements Plugin<void, void, {}, StartDep
async mount(params: AppMountParameters) {
const [coreStart, depsStart] = await core.getStartServices();
const { renderApp } = await import('./app');
await depsStart.embeddableExamples.createSampleData();
try {
await depsStart.embeddableExamples.createSampleData();
} catch (error) {
// eslint-disable-next-line no-console
console.error('Failed to create sample data', error);
}
return renderApp(
{
notifications: coreStart.notifications,
Expand Down

0 comments on commit 8f4de1b

Please sign in to comment.