[SLING-4275] API: Exceptions

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[SLING-4275] API: Exceptions

Felix Meschberger-3
Hi all

Carsten started to review the Sightly Engine API in SLING-4275 [1]. Since this issue covers 4 topics, I think it would be best to quickly discuss these topic in separate threads.

#1 Exceptions

The root exception is SightlyException extends SlingException. As such it is a RuntimeException.

Question is whether we need an exception hierarchy or not.

The current exception types are thrown from different extension of the Sightly Engine such as RuntimeExtension instances or UseProviders.

Most of the time these exceptions are caught and handled inside the Sightly Engine. As such it might be conceivable to actually collapse those exceptions into the root SightlyException.

On the other hand: Are there exceptions defined that we expect to be caught by consumer code outside of the Sightly Engine ? Such exceptions probably make sense and should be kept.

WDYT ?

Regards
Felix

[1] https://issues.apache.org/jira/browse/SLING-4275
Reply | Threaded
Open this post in threaded view
|

Re: [SLING-4275] API: Exceptions

Radu Cotescu-3
Hi,

I think that we can collapse the exception into the root SightlyException,
Carsten's proposal makes sense.

Regards,
Radu

On Mon, Jan 12, 2015 at 11:44 AM, Felix Meschberger <[hidden email]>
wrote:

> Hi all
>
> Carsten started to review the Sightly Engine API in SLING-4275 [1]. Since
> this issue covers 4 topics, I think it would be best to quickly discuss
> these topic in separate threads.
>
> #1 Exceptions
>
> The root exception is SightlyException extends SlingException. As such it
> is a RuntimeException.
>
> Question is whether we need an exception hierarchy or not.
>
> The current exception types are thrown from different extension of the
> Sightly Engine such as RuntimeExtension instances or UseProviders.
>
> Most of the time these exceptions are caught and handled inside the
> Sightly Engine. As such it might be conceivable to actually collapse those
> exceptions into the root SightlyException.
>
> On the other hand: Are there exceptions defined that we expect to be
> caught by consumer code outside of the Sightly Engine ? Such exceptions
> probably make sense and should be kept.
>
> WDYT ?
>
> Regards
> Felix
>
> [1] https://issues.apache.org/jira/browse/SLING-4275