Skip to main content

Exception handling

Hierarchy

  • AdiqGtefException (base)
    • ErroNaoPrevistoException
    • ServicoErroOperacaoException
    • ServicoIndisponivelException
    • ServicoNaoParametrizadoException

How to handle

try
{
var pagamento = await AdiqGtefApi.CapturarPagamento(100_00, ModoVenda.DEBITO, 1);
}
catch (ServicoIndisponivelException ex)
{
// service/infrastructure unavailable
}
catch (ServicoErroOperacaoException ex)
{
// error reported by the remote service
}
catch (ServicoNaoParametrizadoException ex)
{
// missing configuration/parameterization
}
catch (ErroNaoPrevistoException ex)
{
// unexpected failure
}