Skip to content

Commit

Permalink
Melhorias exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel-Oliveira committed May 3, 2023
1 parent cbc2fba commit c5e1f4f
Show file tree
Hide file tree
Showing 16 changed files with 21 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/main/java/br/com/swconsultoria/nfe/Assinar.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private static String assinaDocNFe(ConfiguracoesNfe config, String xml, Assinatu
| InvalidAlgorithmParameterException | KeyStoreException | UnrecoverableEntryException
| CertificadoException | MarshalException
| XMLSignatureException e) {
throw new NfeException("Erro ao Assinar Nfe" + e.getMessage());
throw new NfeException("Erro ao Assinar Nfe" + e.getMessage(),e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ static TRetEnvEvento eventoAtorInteressado(ConfiguracoesNfe config, TEnvEvento e
return XmlNfeUtil.xmlToObject(xml, TRetEnvEvento.class);

} catch (JAXBException e) {
throw new NfeException(e.getMessage());
throw new NfeException(e.getMessage(),e);
}

}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/br/com/swconsultoria/nfe/Cancelar.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ static TRetEnvEvento eventoCancelamento(ConfiguracoesNfe config, TEnvEvento envi
return XmlNfeUtil.xmlToObject(xml, TRetEnvEvento.class);

} catch (JAXBException e) {
throw new NfeException(e.getMessage());
throw new NfeException(e.getMessage(),e);
}

}
Expand All @@ -48,7 +48,7 @@ static br.com.swconsultoria.nfe.schema.envEventoCancSubst.TRetEnvEvento eventoCa
return XmlNfeUtil.xmlToObject(xml, br.com.swconsultoria.nfe.schema.envEventoCancSubst.TRetEnvEvento.class);

} catch (JAXBException e) {
throw new NfeException(e.getMessage());
throw new NfeException(e.getMessage(),e);
}

}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/br/com/swconsultoria/nfe/CartaCorrecao.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ static TRetEnvEvento eventoCCe(ConfiguracoesNfe config, TEnvEvento enviEvento, b
return XmlNfeUtil.xmlToObject(xml, TRetEnvEvento.class);

} catch (JAXBException e) {
throw new NfeException(e.getMessage());
throw new NfeException(e.getMessage(),e);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ static TRetConsCad consultaCadastro(ConfiguracoesNfe config, PessoaEnum tipoPess
}

} catch (RemoteException | XMLStreamException | JAXBException e) {
throw new NfeException(e.getMessage());
throw new NfeException(e.getMessage(),e);
}

}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/br/com/swconsultoria/nfe/ConsultaRecibo.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ static TRetConsReciNFe reciboNfe(ConfiguracoesNfe config, String recibo, Documen
return XmlNfeUtil.xmlToObject(result.getExtraElement().toString(), TRetConsReciNFe.class);

} catch (RemoteException | XMLStreamException | JAXBException e) {
throw new NfeException(e.getMessage());
throw new NfeException(e.getMessage(),e);
}

}
Expand Down
7 changes: 5 additions & 2 deletions src/main/java/br/com/swconsultoria/nfe/ConsultaXml.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
import br.com.swconsultoria.nfe.exception.NfeException;
import br.com.swconsultoria.nfe.schema_4.consSitNFe.TConsSitNFe;
import br.com.swconsultoria.nfe.schema_4.retConsSitNFe.TRetConsSitNFe;
import br.com.swconsultoria.nfe.util.*;
import br.com.swconsultoria.nfe.util.ConstantesUtil;
import br.com.swconsultoria.nfe.util.ObjetoUtil;
import br.com.swconsultoria.nfe.util.WebServiceUtil;
import br.com.swconsultoria.nfe.util.XmlNfeUtil;
import br.com.swconsultoria.nfe.wsdl.NFeConsultaProtocolo.NFeConsultaProtocolo4Stub;
import lombok.extern.java.Log;
import org.apache.axiom.om.OMElement;
Expand Down Expand Up @@ -87,7 +90,7 @@ static TRetConsSitNFe consultaXml(ConfiguracoesNfe config, String chave, Documen
}

} catch (RemoteException | XMLStreamException | JAXBException e) {
throw new NfeException(e.getMessage());
throw new NfeException(e.getMessage(),e);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static RetDistDFeInt consultaNfe(ConfiguracoesNfe config, PessoaEnum tipoPessoa,
RetDistDFeInt.class);

} catch (RemoteException | XMLStreamException | JAXBException e) {
throw new NfeException(e.getMessage());
throw new NfeException(e.getMessage(),e);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/br/com/swconsultoria/nfe/Enviar.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ static TEnviNFe montaNfe(ConfiguracoesNfe config, TEnviNFe enviNFe, boolean vali
return XmlNfeUtil.xmlToObject(xml, TEnviNFe.class);

} catch (Exception e) {
throw new NfeException(e.getMessage());
throw new NfeException(e.getMessage(),e);
}

}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/br/com/swconsultoria/nfe/Epec.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ static TRetEnvEvento eventoEpec(ConfiguracoesNfe config, TEnvEvento enviEvento,
return XmlNfeUtil.xmlToObject(xml, TRetEnvEvento.class);

} catch (JAXBException e) {
throw new NfeException(e.getMessage());
throw new NfeException(e.getMessage(),e);
}

}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/br/com/swconsultoria/nfe/Eventos.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static String enviarEvento(ConfiguracoesNfe config, String xml, ServicosEnum tip
log.info("[XML-RETORNO-" + tipoEvento + "]: " + result.getExtraElement().toString());
return result.getExtraElement().toString();
} catch (RemoteException | XMLStreamException e) {
throw new NfeException(e.getMessage());
throw new NfeException(e.getMessage(),e);
}

}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/br/com/swconsultoria/nfe/Inutilizar.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static TRetInutNFe inutiliza(ConfiguracoesNfe config, TInutNFe inutNFe, Document
log.info("[XML-RETORNO]: " + result.getExtraElement().toString());
return XmlNfeUtil.xmlToObject(result.getExtraElement().toString(), TRetInutNFe.class);
} catch (RemoteException | XMLStreamException | JAXBException e) {
throw new NfeException(e.getMessage());
throw new NfeException(e.getMessage(),e);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ static TRetEnvEvento eventoManifestacao(ConfiguracoesNfe config, TEnvEvento envE
return XmlNfeUtil.xmlToObject(xml, TRetEnvEvento.class);

} catch (JAXBException e) {
throw new NfeException(e.getMessage());
throw new NfeException(e.getMessage(),e);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/br/com/swconsultoria/nfe/Status.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ static TRetConsStatServ statusServico(ConfiguracoesNfe config, DocumentoEnum tip
}

} catch (RemoteException | XMLStreamException | JAXBException e) {
throw new NfeException(e.getMessage());
throw new NfeException(e.getMessage(),e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public static ConfiguracoesNfe iniciaConfiguracoes(ConfiguracoesNfe configuracoe
CertificadoService.inicializaCertificado(configuracoesNfe.getCertificado());
}
} catch (CertificadoException e) {
throw new NfeException(e.getMessage());
throw new NfeException(e.getMessage(),e);
}

return configuracoesNfe;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public static String getUrl(ConfiguracoesNfe config, DocumentoEnum tipoDocumento
return url;

} catch (IOException e) {
throw new NfeException(e.getMessage());
throw new NfeException(e.getMessage(),e);
}

}
Expand Down

0 comments on commit c5e1f4f

Please sign in to comment.