You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by "Thomas Diesler (JIRA)" <ji...@apache.org> on 2010/02/17 23:53:27 UTC
[jira] Updated: (ARIES-179) FrameworkMBean does not log/relay error
info
[ https://issues.apache.org/jira/browse/ARIES-179?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Thomas Diesler updated ARIES-179:
---------------------------------
Attachment: Framework.diff
diff attached
> FrameworkMBean does not log/relay error info
> --------------------------------------------
>
> Key: ARIES-179
> URL: https://issues.apache.org/jira/browse/ARIES-179
> Project: Aries
> Issue Type: Bug
> Components: JMX
> Reporter: Thomas Diesler
> Attachments: Framework.diff
>
>
> Various operations on the Framework don't log nor relay what went wrong in case of error.
> The typical pattern is
> public long installBundle(String location) throws IOException {
> try {
> Bundle bundle = context.installBundle(location);
> return bundle.getBundleId();
> } catch (BundleException be) {
> throw new IOException("Can't install bundle with location: " + location);
> }
> }
> Instead, I suggest an approach like this
> public long installBundle(String location) throws IOException {
> try {
> Bundle bundle = context.installBundle(location);
> return bundle.getBundleId();
> } catch (BundleException be) {
> IOException ioex = new IOException("Can't install bundle with location: " + location);
> ioex.initCause(be);
> throw ioex;
> }
> }
> Alternatively, this would also work
> public long installBundle(String location) throws IOException {
> try {
> Bundle bundle = context.installBundle(location);
> return bundle.getBundleId();
> } catch (BundleException be) {
> log.error("Can't install bundle with location: " + location, be)
> throw new IOException("Can't install bundle with location: " + location);
> }
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.