You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Tim Sawyer <ti...@calidris.force9.co.uk> on 2003/02/26 23:52:48 UTC

[BeanUtils] Error Message Request

Can I request a change to the error handling in the PropertyUtils class
please?

The last line of this class is a 

  writeMethod.invoke(bean, values);

in the setProperty() method.  This can fail with a 

  java.lang.IllegalArgumentException: argument type mismatch

and this error is then propogated out to the caller directly.  If this
setProperty() method is called from copyProperties(), then a developer
seeing this error has no idea which attribute on the class caused the
problem, and hence is at something of a loss to work out what's wrong,
especially when there are lots of attributes.

Can this exception be wrappered by another which a more detailed
message, that identifies which attribute caused the problem?  I haven't
just spent a couple of hours banging my head against this problem this
afternoon, honest...

Cheers,

Tim.


Re: [BeanUtils] Error Message Request

Posted by Tim Sawyer <ti...@calidris.force9.co.uk>.
On Tue, 2003-03-04 at 19:33, robert burrell donkin wrote:
> hi tim
> 
> i've now committed a fix for this. IllegalArgumentException from method 
> invocations should now be caught and rethrown with a better message.

Ta very much.

Tim.


Re: [BeanUtils] Error Message Request

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
hi tim

i've now committed a fix for this. IllegalArgumentException from method 
invocations should now be caught and rethrown with a better message.

- robert

On Wednesday, February 26, 2003, at 10:52 PM, Tim Sawyer wrote:

> Can I request a change to the error handling in the PropertyUtils class
> please?
>
> The last line of this class is a
>
>   writeMethod.invoke(bean, values);
>
> in the setProperty() method.  This can fail with a
>
>   java.lang.IllegalArgumentException: argument type mismatch
>
> and this error is then propogated out to the caller directly.  If this
> setProperty() method is called from copyProperties(), then a developer
> seeing this error has no idea which attribute on the class caused the
> problem, and hence is at something of a loss to work out what's wrong,
> especially when there are lots of attributes.
>
> Can this exception be wrappered by another which a more detailed
> message, that identifies which attribute caused the problem?  I haven't
> just spent a couple of hours banging my head against this problem this
> afternoon, honest...
>
> Cheers,
>
> Tim.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>