You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Mikhail Loenko <ml...@gmail.com> on 2006/06/13 18:20:31 UTC

[tools] HARMONY-598 (Keytool - added keystore loading, keytool-specific exception type, misc.)

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


Re: [tools] HARMONY-598 (Keytool - added keystore loading, keytool-specific exception type, misc.)

Posted by Mikhail Loenko <ml...@gmail.com>.
Ok, I see

2006/6/15, Anton Rusanov <an...@gmail.com>:
> 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 <ml...@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
>
>

---------------------------------------------------------------------
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


Re: [tools] HARMONY-598 (Keytool - added keystore loading, keytool-specific exception type, misc.)

Posted by Anton Rusanov <an...@gmail.com>.
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 <ml...@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