namespace ZB.MOM.WW.Auth.ApiKeys;
///
/// Thrown when an API-key operation needs the secret pepper but
/// returned null, empty or whitespace
/// (create and rotate in ApiKeyAdminCommands).
///
///
/// Derives from , which is what these paths threw before
/// this type existed, so existing catch (InvalidOperationException) blocks keep working.
/// The message stays "pepper unavailable". Consumers can catch this type instead of
/// pre-checking themselves or matching the message. The verifier
/// does not throw it: a missing pepper surfaces there as ApiKeyFailure.PepperUnavailable.
///
public sealed class ApiKeyPepperUnavailableException : InvalidOperationException
{
/// Creates the exception with the default "pepper unavailable" message.
public ApiKeyPepperUnavailableException()
: base("pepper unavailable")
{
}
/// Creates the exception with a custom message.
public ApiKeyPepperUnavailableException(string message)
: base(message)
{
}
/// Creates the exception with a custom message and inner exception.
public ApiKeyPepperUnavailableException(string message, Exception innerException)
: base(message, innerException)
{
}
}