Table of Contents

Class GoneError

Namespace
Trellis
Assembly
Trellis.Results.dll

Represents a permanent removal error when a resource is no longer available and no forwarding address is known. This condition is expected to be permanent. Use this instead of NotFoundError when the server knows the resource previously existed and has been intentionally removed. Maps to HTTP 410 Gone.

public sealed class GoneError : Error, IEquatable<Error>
Inheritance
GoneError
Implements
Inherited Members
Extension Methods

Examples

Error.Gone("This product has been permanently discontinued")
Error.Gone("API endpoint /v1/users has been retired. Use /v2/users instead")

Remarks

Use this for intentional permanent removal scenarios: - Soft-deleted resources that should not be re-fetched - Deprecated API endpoints that have been retired - Content that has been taken down permanently

If you don't know whether the condition is permanent, use NotFoundError instead.

Constructors

GoneError(string, string, string?)

Initializes a new instance of the GoneError class.

public GoneError(string detail, string code, string? instance = null)

Parameters

detail string

Description of why the resource is gone.

code string

The error code identifying this type of gone error.

instance string

Optional identifier for the removed resource.