harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anton Rusanov" <anton.d.rusa...@gmail.com>
Subject Re: [tools] HARMONY-598 (Keytool - added keystore loading, keytool-specific exception type, misc.)
Date Thu, 15 Jun 2006 07:28:11 GMT
Mikhail,
the user working with Keytool may need to know what operation of
Keytool failed and the cause of the failure.
The messages in IOException, CertificateException and others are API
or provider specific and therefore are not so useful for the user.
In exceptions thrown by me I set the message showing the __Keytool
operation__ which has the problem and some details. This is what is
expected from the tool.



2006/6/13, Mikhail Loenko <mloenko@gmail.com>:
> Hi Anton
>
> Sorry I'm not a guru in keytools but why catch exceptions and resend them?
>
> +        try {
> +            // try to load the keystore
> +            keyStore.load(fis, storePass);
> +        } catch (NoSuchAlgorithmException e) {
> +            throw new NoSuchAlgorithmException(
> +                    "Failed to find the algorithm to check the
> keystore integrity",
> +                    e);
> +        } catch (CertificateException e) {
> +            throw new CertificateException(
> +                    "Failed to load a certificate from the keystore. ", e);
> +        } catch (IOException e) {
> +            throw (IOException) new IOException("Failed to load the
> keystore. ")
> +                    .initCause(e);
> +        }
> +        return keyStore;
> +    }
>
> Thanks,
> Mikhail
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>



-- 
Thanks,
Anton

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message