Well, this was the central tenet of my blog. Never catch exceptions when you
cannot do something really useful with them (like 99% of the cases) and let
them bubble up to the highest level. At the highest level you usually have a
clear way to report back what went wrong. E.g. before you call a servlet, etc.
Unfortunately, there is no generic mechanism that I know off and I expect this
is not really possible because it depends.
Kind regards,
Peter Kriens
On 12 mrt 2011, at 09:26, Michael Hüttermann wrote:
>
> Hi Peter,
> yes, my question looks strongly like a follow-up to your blog post. I want to
> trace/report all exceptions, and I neither want to use AOP, nor do I want to
> add additional boiler plate code to every single try/catch-block. Rather I'm
> looking for a central place where I'm informed about all "exceptional
> behavior". If I would propagate all exceptions (not catching them at all, as
> you've written in your blog), what would be the central, upper-most location
> in an OSGi bundle to catch all exceptions then?
>
> Thank you.
>
> Regards
> Michael
>
>
>
> Am Freitag, den 11.03.2011, 18:50 +0100 schrieb Peter Kriens
> <[email protected]>:
>> I am not sure I understand the question, in Java the exceptions are
>> thrown to callers so a good design allows the top level to centralize
>> handling exceptions (see my blog about Exception Hygiene). However,
>> this is kind of orthogonal to OSGi.
>>
>> Kind regards,
>>
>> Peter Kriens
>>
>> On 11 mrt 2011, at 10:21, Michael Hüttermann wrote:
>>
>>>
>>> Hello,
>>>
>>> I want to aggregate all (or at least a subset of) possible exceptions in my
>>> bundles for error reporting. I'm using bundles that directly use classes of
>>> other bundles as well as services. What is the recommended design for this?
>>> Or is there any specific feature that could help here? Can I propagate all
>>> exceptions to a central place to manage them there centrally? (maybe an
>>> Activator can help here, but how?)
>>>
>>> Thank you.
>>>
>>>
>>> Regards
>>> Michael
>>>
>>>
>>> _______________________________________________
>>> OSGi Developer Mail List
>>> [email protected]
>>> https://mail.osgi.org/mailman/listinfo/osgi-dev
>>
>>
>> _______________________________________________
>> OSGi Developer Mail List
>> [email protected]
>> https://mail.osgi.org/mailman/listinfo/osgi-dev
>
>
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev