Skip to content

RescueExtensions

Namespace: Hex1b

Assembly: Hex1b.dll

Extension methods for building RescueWidget.

csharp
public static class RescueExtensions

Inheritance

ObjectRescueExtensions

Methods

Rescue<TParent>(WidgetContext<TParent>, Func<WidgetContext<VStackWidget>, Hex1bWidget[]>)

Wraps a VStack in a rescue boundary that catches exceptions and displays a fallback.

Parameters:

Returns: RescueWidget

A new RescueWidget containing a VStack.

csharp
public static RescueWidget Rescue<TParent>(this WidgetContext<TParent> ctx, Func<WidgetContext<VStackWidget>, Hex1bWidget[]> childBuilder) where TParent : Hex1bWidget

Rescue<TParent>(WidgetContext<TParent>, Hex1bWidget)

Wraps a widget in a rescue boundary that catches exceptions and displays a fallback.

Parameters:

  • ctx (WidgetContext<<TParent>>): The widget context.
  • child (Hex1bWidget): The child widget to protect.

Returns: RescueWidget

A new RescueWidget.

csharp
public static RescueWidget Rescue<TParent>(this WidgetContext<TParent> ctx, Hex1bWidget child) where TParent : Hex1bWidget

RescueFriendly<TParent>(WidgetContext<TParent>, Hex1bWidget)

Wraps a widget in a rescue boundary with hidden exception details. Useful for production environments where you want a friendly error message.

Parameters:

  • ctx (WidgetContext<<TParent>>): The widget context.
  • child (Hex1bWidget): The child widget to protect.

Returns: RescueWidget

A new RescueWidget with ShowDetails set to false.

csharp
public static RescueWidget RescueFriendly<TParent>(this WidgetContext<TParent> ctx, Hex1bWidget child) where TParent : Hex1bWidget

Released under the MIT License.