diff --git a/src/main/java/br/com/correios/api/postagem/CorreiosPostagemApi.java b/src/main/java/br/com/correios/api/postagem/CorreiosPostagemApi.java index ee6c355..e201d09 100644 --- a/src/main/java/br/com/correios/api/postagem/CorreiosPostagemApi.java +++ b/src/main/java/br/com/correios/api/postagem/CorreiosPostagemApi.java @@ -18,7 +18,6 @@ import br.com.correios.credentials.CorreiosCredenciais; import br.com.correios.webservice.postagem.AutenticacaoException; import br.com.correios.webservice.postagem.ClienteERP; -import br.com.correios.webservice.postagem.SigepClienteException; public class CorreiosPostagemApi implements PostagemApi { @@ -52,10 +51,8 @@ public Optional buscaCliente(ContratoEmpresa informacao) { } } catch (AutenticacaoException e) { throw new CorreiosPostagemAutenticacaoException(format("Ocorreu um erro ao se autenticar nos correios com a seguinte credencial: %s", credenciais)); - } catch (SigepClienteException e) { - throw new CorreiosServicoSoapException(format("Ocorreu um erro ao chamar o serviço com as informações de cliente %s", informacao), e); } catch (Exception e) { - return Optional.absent(); + throw new CorreiosServicoSoapException(format("Ocorreu um erro ao chamar o serviço com as informações de cliente %s", informacao), e); } return Optional.absent(); } @@ -78,10 +75,8 @@ public Optional buscaDocumentoPlp(Long plpId) { } } catch (AutenticacaoException e) { throw new CorreiosPostagemAutenticacaoException(format("Ocorreu um erro ao se autenticar nos correios com a seguinte credencial: %s", credenciais)); - } catch (SigepClienteException e) { - throw new CorreiosServicoSoapException(format("Ocorreu um erro ao chamar o serviço com o PLP de id %d", plpId), e); } catch (Exception e) { - return Optional.absent(); + throw new CorreiosServicoSoapException(format("Ocorreu um erro ao chamar o serviço com o PLP de id %d", plpId), e); } return Optional.absent(); }