Skip to content

Property Critical

Namespace: Belay.Attributes
Assembly: Belay.Attributes.dll

Critical

Gets or sets a value indicating whether gets or sets whether setup failure should be treated as a critical error. When true, setup failure will cause device connection to fail completely. When false, setup failure will be logged but connection will proceed.

csharp
public bool Critical { get; set; }

Property Value

bool

Examples

public class IoTDevice : Device
{
    [Setup(Critical = true)]
    private async Task InitializeCore()
    {
        // Essential initialization - must succeed
        await ExecuteAsync("initialize_core_systems()");
    }

    [Setup(Critical = false)]
    private async Task LoadOptionalConfig()
    {
        // Optional configuration - can fail gracefully
        await ExecuteAsync("load_user_preferences()");
    }
}

Remarks

Set Critical to false for optional setup operations that should not prevent device usage if they fail, such as loading optional configuration or initializing non-essential peripherals.

Critical setup methods that fail will prevent the device from being marked as connected, and subsequent setup methods will not execute.

Released under the Apache License 2.0.