[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: throwing & catching exceptions from object creation
On Mon, 02 Jul 2001, Don Berendsen wrote:
> In my application if an object is created without valid data the constructor
> throws an InvalidUpdateException that contains a list of the validity
> constraints that were violated.
>
> However when the ctor throws the InvalidUpdateException apparently the it is
> wrapped in an InvocationTargetException and when it gets to the Transaction
> an OzoneInternalExc is thrown rather than the original
> InvalidUpdateException.
>
> Is it possible to have the original InvalidUpdateException thrown by the
> Transaction back to the code that invokes the object creation?
I checked in a _quick_ fix in the HEAD branch of CVS (version 1.1.x). I just
copied the catch(InvocationTargetException...) block from invokeTarget() into
org.ozoneDB.core.Transaction.createObject(). Please, check this! I did _not_
test it in any way.
Falko
>
> Thanks,
>
> Don
>
>
>
>
> -------------- log entry --------------------
>
> [warn] (540) Transaction: createObject()
> java.lang.reflect.InvocationTargetException:
> au.com.harrison.innerview.util.InvalidUpdateException at
> au.com.harrison.innerview.util.NamedHierarchicalElementImpl.setNam
> e(NamedHierarchicalElementImpl.java:65)
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
>
> ----------------------------------------------------------------------
> Post a message: mailto:ozone-users@ozone-db.org
> Unsubscribe: mailto:ozone-users-request@ozone-db.org?body=unsubscribe
> Contact adminstrator: mailto:ozone-users-owner@ozone-db.org
> Read archived messages: http://www.ozone-db.org/
> ----------------------------------------------------------------------
--
______________________________________________________________________
Falko Braeutigam mailto:falko@smb-tec.com
SMB GmbH http://www.smb-tec.com
----------------------------------------------------------------------
Post a message: mailto:ozone-users@ozone-db.org
Unsubscribe: mailto:ozone-users-request@ozone-db.org?body=unsubscribe
Contact adminstrator: mailto:ozone-users-owner@ozone-db.org
Read archived messages: http://www.ozone-db.org/
----------------------------------------------------------------------