Make embeddable example plugin not fail for read-only user (#125459)

* wrap write operation in try-catch block

* add space
This commit is contained in:
Vadim Kibana 2022-02-14 10:33:32 +01:00 committed by GitHub
parent 759f87b1f2
commit 8f4de1b8a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,