Class ServiceUnavailableError
- Namespace
- FunctionalDdd
- Assembly
- FunctionalDdd.RailwayOrientedProgramming.dll
Represents a temporary service unavailability error. Use this when the service is temporarily unable to handle the request due to maintenance or overload. Maps to HTTP 503 Service Unavailable.
public sealed class ServiceUnavailableError : Error, IEquatable<Error>
- Inheritance
-
ServiceUnavailableError
- Implements
- Inherited Members
- Extension Methods
Examples
Error.ServiceUnavailable("Service is under maintenance. Please try again later")
Error.ServiceUnavailable("Database connection pool exhausted. Retry in 30 seconds")
Error.ServiceUnavailable("External payment gateway is temporarily unavailable")
Remarks
This indicates a temporary condition - the service is expected to be available again. Include retry-after information in the detail message when appropriate. For permanent unavailability or deprecated endpoints, consider using other error types.
Constructors
ServiceUnavailableError(string, string, string?)
Initializes a new instance of the ServiceUnavailableError class.
public ServiceUnavailableError(string detail, string code, string? instance = null)