namespace Cepis;
///
/// The CEP is well-formed but does not exist in the DNE database.
///
///
///
/// Retrying does not help: the answer is definitive until the next fortnightly
/// database. A batch never throws this — a CEP with no address is
/// at its position instead.
///
///
/// carries the municipality the CEP would have belonged to,
/// when the API can name one. It is context for the failure and not a fallback
/// address: this is still a 404.
///
///
public sealed class CepNotFoundException : CepisException
{
/// Create the exception with a message and the range, if any.
/// what went wrong
///
/// the municipality the CEP would belong to, or when
/// the API named none
///
public CepNotFoundException(string message, Faixa? faixa = null)
: base(message)
{
Faixa = faixa;
}
/// Create the exception with a message, the range and a cause.
/// what went wrong
/// the municipality the CEP would belong to, if any
/// the failure underneath
public CepNotFoundException(string message, Faixa? faixa, Exception? innerException)
: base(message, innerException)
{
Faixa = faixa;
}
///
/// The municipality the CEP would have belonged to, or
/// when there is none.
///
///
///
/// is the ordinary case for a CEP falling in a band
/// no municipality owns: the API omits the block rather than sending
/// a null, and an older API does not send it at all. Anything unreadable in
/// it lands here as too — a courtesy field is not
/// worth turning a clean not-found into a parse error over.
///
///
/// It says which municipality the number would be in, not that any
/// address exists. Read before using
/// and :
/// they bound the CEPs that exist there, and the range between them is
/// mostly empty.
///
///
public Faixa? Faixa { get; }
}