Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -52,10 +51,8 @@ public Optional<ClienteEmpresa> 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();
}
Expand All @@ -78,10 +75,8 @@ public Optional<DocumentoPlp> 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();
}
Expand Down