RunicFailureAttribute class

Namespace Runic.Application.Views · Runic.Application 0.7.0-preview.5

public sealed class RunicFailureAttribute : Attribute

Inherits or implements Attribute.

Declares the expected failure type of a bridged command. Put it on the command property or on a CommunityToolkit [RelayCommand] method. The command signals the failure by throwing RunicFailureException with a value of this type; the generated client receives it as a typed failure instead of an error.

Remarks

A command declares one failure type. Several cases use [RunicUnion]. Synchronous commands report only failures thrown synchronously from Execute; operations exist only for asynchronous Toolkit and ReactiveUI commands.

Constructors

RunicFailureAttribute

public RunicFailureAttribute(Type failure)

Declares the expected failure type of a bridged command. Put it on the command property or on a CommunityToolkit [RelayCommand] method. The command signals the failure by throwing RunicFailureException with a value of this type; the generated client receives it as a typed failure instead of an error.

Remarks

A command declares one failure type. Several cases use [RunicUnion]. Synchronous commands report only failures thrown synchronously from Execute; operations exist only for asynchronous Toolkit and ReactiveUI commands.

Properties

Failure

public Type Failure { get; }

The CLR type of the command's declared failure.