commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jochen Wiedmann" <jochen.wiedm...@gmail.com>
Subject Re: [CODEC] Base64 decode() handling of invalid encoded data
Date Mon, 14 Jul 2008 14:04:51 GMT
On Mon, Jul 14, 2008 at 3:37 PM, sebb <sebbaz@gmail.com> wrote:

> Should have tried it before posting ...
>
> Both IOException and DecoderException are checked, and so this means
> that the method signature for
>
> public static byte[] decodeBase64()
>
> would need to change - or the method needs to convert the
> DecoderException to an unchecked error.
>
> Thoughts?

In such cases I'd recommend to catch the Exception and convert it into
an UndeclaredThrowableException. However, I'd also deprecate the
method and add a successor. I'd discourage things like adding a
boolean flag that suppresses the exception.


Jochen



-- 
Look, that's why there's rules, understand? So that you think before
you break 'em.

 -- (Terry Pratchett, Thief of Time)

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


Mime
View raw message