IDEMPIERE-1529 Dangerous catch exceptions (hiding or ignoring real problem)

This commit is contained in:
Carlos Ruiz 2013-11-13 08:16:52 -05:00
parent 1e227ac399
commit c2729ab53f
4 changed files with 10 additions and 6 deletions

View File

@ -23,6 +23,7 @@ import java.sql.Timestamp;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.logging.Level; import java.util.logging.Level;
import org.adempiere.exceptions.AdempiereException;
import org.compiere.model.I_C_InvoiceLine; import org.compiere.model.I_C_InvoiceLine;
import org.compiere.model.MInOut; import org.compiere.model.MInOut;
import org.compiere.model.MInOutLine; import org.compiere.model.MInOutLine;
@ -112,7 +113,7 @@ public class InOutGenerateRMA extends SvrProcess
} }
catch (Exception ex) catch (Exception ex)
{ {
log.log(Level.SEVERE, sql, ex); throw new AdempiereException(ex);
} }
finally finally
{ {

View File

@ -23,6 +23,7 @@ import java.sql.Timestamp;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.logging.Level; import java.util.logging.Level;
import org.adempiere.exceptions.AdempiereException;
import org.compiere.model.MInvoice; import org.compiere.model.MInvoice;
import org.compiere.model.MInvoiceLine; import org.compiere.model.MInvoiceLine;
import org.compiere.model.MRMA; import org.compiere.model.MRMA;
@ -107,7 +108,7 @@ public class InvoiceGenerateRMA extends SvrProcess
} }
catch (Exception ex) catch (Exception ex)
{ {
log.log(Level.SEVERE, sql, ex); throw new AdempiereException(ex);
} }
finally finally
{ {

View File

@ -24,6 +24,7 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.logging.Level; import java.util.logging.Level;
import org.adempiere.exceptions.AdempiereException;
import org.compiere.model.MClient; import org.compiere.model.MClient;
import org.compiere.model.MInOut; import org.compiere.model.MInOut;
import org.compiere.model.MInOutLine; import org.compiere.model.MInOutLine;
@ -196,7 +197,7 @@ public class InOutGenerate extends SvrProcess
} }
catch (Exception e) catch (Exception e)
{ {
log.log(Level.SEVERE, m_sql.toString(), e); throw new AdempiereException(e);
} }
return generate(pstmt); return generate(pstmt);
} // doIt } // doIt
@ -396,7 +397,7 @@ public class InOutGenerate extends SvrProcess
} }
catch (Exception e) catch (Exception e)
{ {
log.log(Level.SEVERE, m_sql.toString(), e); throw new AdempiereException(e);
} }
finally finally
{ {

View File

@ -22,6 +22,7 @@ import java.sql.ResultSet;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.util.logging.Level; import java.util.logging.Level;
import org.adempiere.exceptions.AdempiereException;
import org.compiere.model.MBPartner; import org.compiere.model.MBPartner;
import org.compiere.model.MClient; import org.compiere.model.MClient;
import org.compiere.model.MCurrency; import org.compiere.model.MCurrency;
@ -178,7 +179,7 @@ public class InvoiceGenerate extends SvrProcess
} }
catch (Exception e) catch (Exception e)
{ {
log.log(Level.SEVERE, sql.toString(), e); throw new AdempiereException(e);
} }
return generate(pstmt); return generate(pstmt);
} // doIt } // doIt
@ -324,7 +325,7 @@ public class InvoiceGenerate extends SvrProcess
} }
catch (Exception e) catch (Exception e)
{ {
log.log(Level.SEVERE, "", e); throw new AdempiereException(e);
} }
finally finally
{ {