db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/core QueryReferenceBroker.java
Date Tue, 06 Dec 2005 15:18:49 GMT
arminw      2005/12/06 07:18:49

  Modified:    src/java/org/apache/ojb/broker/core Tag: OJB_1_0_RELEASE
                        QueryReferenceBroker.java
  Log:
  improve exception handling
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.17.2.16 +19 -7     db-ojb/src/java/org/apache/ojb/broker/core/QueryReferenceBroker.java
  
  Index: QueryReferenceBroker.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/core/QueryReferenceBroker.java,v
  retrieving revision 1.17.2.15
  retrieving revision 1.17.2.16
  diff -u -r1.17.2.15 -r1.17.2.16
  --- QueryReferenceBroker.java	25 Nov 2005 16:27:50 -0000	1.17.2.15
  +++ QueryReferenceBroker.java	6 Dec 2005 15:18:49 -0000	1.17.2.16
  @@ -43,7 +43,6 @@
   import org.apache.ojb.broker.metadata.FieldHelper;
   import org.apache.ojb.broker.metadata.MetadataException;
   import org.apache.ojb.broker.metadata.ObjectReferenceDescriptor;
  -import org.apache.ojb.broker.metadata.SuperReferenceDescriptor;
   import org.apache.ojb.broker.metadata.fieldaccess.PersistentField;
   import org.apache.ojb.broker.query.Criteria;
   import org.apache.ojb.broker.query.Query;
  @@ -266,10 +265,16 @@
               }
               return result;
           }
  -        catch (Throwable e)
  +        catch (Exception e)
           {
  -            e.printStackTrace();
  -            throw new PersistenceBrokerException(e);
  +            if(e instanceof PersistenceBrokerException)
  +            {
  +                throw (PersistenceBrokerException) e;
  +            }
  +            else
  +            {
  +                throw new PersistenceBrokerException(e);
  +            }
           }
       }
   
  @@ -684,8 +689,15 @@
               }
               catch (Exception e)
               {
  -                log.error("Error instantiating obj: " + e.getMessage(), e);
  -                throw new PersistenceBrokerException(e);
  +                log.error("Error while instantiate object " + id + ", msg: "+ e.getMessage(),
e);
  +                if(e instanceof PersistenceBrokerException)
  +                {
  +                    throw (PersistenceBrokerException) e;
  +                }
  +                else
  +                {
  +                    throw new PersistenceBrokerException(e);
  +                }
               }
           }
           else
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message