Ferrous API Reference

All Types / Ferrous

class ErrorMessageAttribute

public sealed class ErrorMessageAttribute : Attribute

Annotates a [DiscriminatedUnion] variant factory method with a human-readable error message template (Rust thiserror #[error("...")] style). Placeholders matching parameter names (e.g., "{port}") are interpolated by the generated FormatError() and ToString() methods.

Constructors

public ErrorMessageAttribute(string template)

Initializes a new ErrorMessageAttribute with the given message template.

Properties

public string Template

Gets the error message template.