Skip to content

[Time to Visualize] Embeddable Error Handling #81399

@ThomThomson

Description

@ThomThomson

Problem

As part of the Time to Visualize project, some embeddables have had their saved object loading responsibilities shifted from the Embeddable Factory, to the Embeddable itself.

The dashboard code is currently set up in such a way that only errors that are thrown during one of the embeddable factory create methods are turned into a proper ErrorEmbeddable:

This causes a bug where any error in the creation of the Embeddable results in a totally blank embeddable.

Screen Shot 2020-10-21 at 4 36 48 PM

Expected

Screen Shot 2020-10-21 at 3 10 29 PM

Steps to reproduce

  1. Create a lens embeddable, add it to the library
  2. Add that embeddable to a dashboard
  3. Delete that embeddable through saved objects management
  4. Reload the dashboard.

Potential Solution

What we need is a way for embeddables themselves to catch and throw errors that the embeddable panel can subscribe to, in order to render an ErrorEmbeddable instead. I can think of two ways to accomplish this:

  • Add an onError$ observable of type ErrorEmbeddable to i_embeddable and the abstract embeddable.tsx. Have the embeddable panel subscribe to this, which will destroy the existing embeddable and replace it with the error embeddable. This works, though it could easily be improved upon. [Time to Visualize] Embeddable Error Handling Via OnError Observable #81402

  • Add a fatalError property of type ErrorEmbeddable to IEmbeddableOutput (something similar has been done before for the error badge). In the embeddable panel's output subscription, if the fatalError prop is present, destroy the existing embeddable and replace it with the error embeddable. This may be a cleaner solution.

@Dosant @streamich @stacey-gammon. Let me know if you have any other ideas!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature:DashboardDashboard related featuresProject:TimeToVisualizeTeam:PresentationPresentation Team for Dashboard, Input Controls, and Canvas t//bugFixes for quality problems that affect the customer experienceregression

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions