showFailureToast

Function that shows a failure Toast for a given Error.

Signature

function showFailureToast(
  error: unknown,
  options?: {
    title?: string;
    primaryAction?: Toast.ActionOptions;
  },
): Promise<T>;

Arguments

  • error is the error to report.

With a few options:

  • options.title is a string describing the action that failed. By default, "Something went wrong"

  • options.primaryAction is a Toast Action.

Return

Returns a Toast.

Example

Last updated