commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From __matthewHawthorne <>
Subject Re: [BEANUTILS] Any way to get more helpful error messages from BeanUtils.copyProperties?
Date Wed, 20 Aug 2003 01:32:34 GMT
I agree that it makes sense to create some type of pluggable property
exception handling.  Perhaps a user can set listeners or handlers such

	eventOccured(PropertyEvent e)


	handleWarning(PropertyException ex)
	handleError(PropertyException ex)

Another idea I've had while using beanutils is the redundancy of having
to catch IllegalAccessException, InvocationTargetException, and
NoSuchMethodException for a lot of the method calls.  I use a small
utility which delegates the call to beanutils, and if an exception
occurs, wraps it in another exception (something like BeanException or

Would adding wrappers for the *Utils be useful, or are there frequent
cases where users perform different actions based on the type of
exception that occurs?  My actions for each type of exception are
usually identical.

On Tue, 2003-08-19 at 13:30, robert burrell donkin wrote:
> at the moment, the answer is: not easily. the problem is that beanutils is 
> rather hamstrung by backwards compatibility. there has been talk of 
> factoring out the exception handling so that it could either be hooked 
> into by a pluggable interface or the behaviour subclassed.
> or maybe there's a case for developing subclass exceptions.
> anyone else have any opinions on this?
> - robert
> On Friday, August 15, 2003, at 07:10 PM, K.C. Baltz wrote:
> > Is there any way to get BeanUtils.copyProperties to let you know which 
> > property failed when you get an "argument type mismatch"?  Right now, I 
> > just get an exception and am left to guess which bean property didn't 
> > match.
> >
> > K.C.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > For additional commands, e-mail:
> >
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View raw message