You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by "Adam Wojtuniak (JIRA)" <ji...@apache.org> on 2010/02/18 01:17:27 UTC

[jira] Commented: (ARIES-179) FrameworkMBean does not log/relay error info

    [ https://issues.apache.org/jira/browse/ARIES-179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12835066#action_12835066 ] 

Adam Wojtuniak commented on ARIES-179:
--------------------------------------

Hi Thomas

This issue is already fixed by ARIES-160 Set the initCause of exceptions in Framework.java and UserAdmin.java.
Thanks for diff file.

Regards,
Adam

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