Skip to content

[Feature] Expose a public ThrowHelper type #3322

@john-h-k

Description

@john-h-k

Describe the problem this feature would solve

Currently, the Guard API is suitable for parameter validation but nothing more, and consumers still likely need a ThrowHelper type for other sorts of exceptions

Describe the solution

Expose a public ThrowHelper type (the current one internal) that provides throwing methods for a wider variety of types. The basic layout of each method would be

[DoesNotReturn]
public void ThrowFooException(string? message = null, Exception inner? = null)
{
    throw new FooException(message, inner);
}

With different params for exceptions with special ctors

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions