Skip to content

Commit

Permalink
Merge pull request #57 from alexandregama/fix-encoding
Browse files Browse the repository at this point in the history
[fix-encoding] - Corrige encoding
  • Loading branch information
ericdallo authored Feb 6, 2017
2 parents 1afdcc8 + c851aa0 commit 59b2cf6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=0.0.11-BETA
version=0.0.12-BETA
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

import static java.lang.String.format;

import java.util.NoSuchElementException;

import com.google.common.base.Optional;

import br.com.correios.api.exception.CorreiosServicoSoapException;
import br.com.correios.api.postagem.cliente.ClienteEmpresa;
import br.com.correios.api.postagem.cliente.ClienteInformacao;
import br.com.correios.api.postagem.cliente.ClienteRetornadoDosCorreiosToClienteConverter;
Expand Down Expand Up @@ -47,8 +46,12 @@ public Optional<ClienteEmpresa> buscaCliente(ClienteInformacao informacao) {
ClienteEmpresa cliente = new ClienteRetornadoDosCorreiosToClienteConverter().convert(clienteRetornadoDosCorreios);
return Optional.of(cliente);
}
} catch (AutenticacaoException | SigepClienteException e) {
throw new CorreiosPostagemAutenticacaoException(format("Ocorreu um erro ao se autenticar nos correios com a seguinte credencial: ", credenciais));
} 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();
}
return Optional.absent();
}
Expand All @@ -69,10 +72,10 @@ public Optional<DocumentoPlp> buscaDocumentoPlp(Long plpId) {
return new CorreiosLogToPlpDocumentoConverter().convert(correiosPlp.get());
}
}
} catch (AutenticacaoException | SigepClienteException e) {
throw new CorreiosPostagemAutenticacaoException(format("Ocorreu um erro ao se autenticar nos correios com a seguinte credencial: ", credenciais));
} catch (NoSuchElementException e) {
return Optional.absent();
} 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();
}
Expand Down

0 comments on commit 59b2cf6

Please # to comment.