exception handling in OPS

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

exception handling in OPS

achai277
I have read from http://www.orbeon.com/ops/doc/reference-error-pipeline that it is possible for a developer to display a different error page instead of the default error page. Instead of going through the error.xpl pipeline for exception handling, is there any other way I can display the exception in a custom error page? Our app would like to display all exceptions in this custom error page for consistency, and also that the exception is easy to read and no stack traces are shown to the user. How could this be achieved?



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: exception handling in OPS

achai277
In response to the first message, I would like to know if it's possible to bypass the error pipeline and let the exception propogate up to the error handler declared in web.xml? This is what we would like to achieve, else we will have to maintain two redirections: one in web.xml and the other in an orbeon error pipeline - it would be best if we could avoid this.



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: exception handling in OPS

Colin O'Brien
In reply to this post by achai277
If you are use Apache (certainly Apache2) to front Tomcat, you can have
a user friendly error page come up instead of the error page.
This is not very granular - for example, if the response is an error
504, you can redirect to your own 504 page, but you don't have a lot of
detail to give the user.
This is useful because in production you have Apache and hide the OPS
details, and in development you do without Apache and then you see all
the details (and you don't need to change anything else).
Hope that helps

On May 8, 2006, at 2:24 AM, [hidden email] wrote:

> I have read from
> http://www.orbeon.com/ops/doc/reference-error-pipeline that it is
> possible for a developer to display a different error page instead of
> the default error page. Instead of going through the error.xpl
> pipeline for exception handling, is there any other way I can display
> the exception in a custom error page? Our app would like to display
> all exceptions in this custom error page for consistency, and also
> that the exception is easy to read and no stack traces are shown to
> the user. How could this be achieved?
>
>
> --
> You receive this message as a subscriber of the
> [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: exception handling in OPS

achai277

Thanks for the advice. Our setup consists of an error handler declared in web.xml, which will display a custom error page with the message from the thrown exception. Is it possible to bypass the error pipeline and let the exception propograte up to the error handler declared in web.xml? Full exception stack trace will be logged in a log file hidden from user view.

Aaron





 

From: Colin O'Brien <[hidden email]>
Reply-To: [hidden email]
To: [hidden email]
Subject: Re: [ops-users] exception handling in OPS
Date: Mon, 8 May 2006 14:35:22 -0400
MIME-Version: 1.0 (Apple Message framework v619)
Received: from mars.objectweb.org ([194.199.16.17]) by bay0-mc7-f14.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 8 May 2006 11:36:08 -0700
Received: from sympa by mars.objectweb.org with local (Exim 3.36 #1 (Debian))id 1FdAaa-0001PP-00; Mon, 08 May 2006 20:36:12 +0200
Received: from mail118.modweft.net ([152.160.3.118] helo=smtpout.modweft.net)by mars.objectweb.org with esmtp (Exim 3.36 #1 (Debian))id 1FdAaT-0001J5-00for <[hidden email]>; Mon, 08 May 2006 20:36:05 +0200
Received: from [192.168.144.2] (w076.z208177185.det-mi.dsl.cnc.net [208.177.185.76])by smtpout.modweft.net (Postfix) with ESMTP id C88B4BB9ABfor <[hidden email]>; Mon, 8 May 2006 14:35:28 -0400 (EDT)

>If you are use Apache (certainly Apache2) to front Tomcat, you can
>have a user friendly error page come up instead of the error page.
>This is not very granular - for example, if the response is an error
>504, you can redirect to your own 504 page, but you don't have a lot
>of detail to give the user.
>This is useful because in production you have Apache and hide the
>OPS details, and in development you do without Apache and then you
>see all the details (and you don't need to change anything else).
>Hope that helps
>
>On May 8, 2006, at 2:24 AM, [hidden email] wrote:
>
>>I have read from
>>http://www.orbeon.com/ops/doc/reference-error-pipeline that it is
>>possible for a developer to display a different error page instead
>>of the default error page. Instead of going through the error.xpl
>>pipeline for exception handling, is there any other way I can
>>display the exception in a custom error page? Our app would like to
>>display all exceptions in this custom error page for consistency,
>>and also that the exception is easy to read and no stack traces are
>>shown to the user. How could this be achieved?
>>
>>
>>--
>>You receive this message as a subscriber of the
>>[hidden email] mailing list.
>>To unsubscribe: mailto:[hidden email]
>>For general help: mailto:[hidden email]?subject=help
>>ObjectWeb mailing lists service home page:
>>http://www.objectweb.org/wws
>
>

>
>--
>You receive this message as a subscriber of the [hidden email] mailing list.
>To unsubscribe: mailto:[hidden email]
>For general help: mailto:[hidden email]?subject=help
>ObjectWeb mailing lists service home page: http://www.objectweb.org/wws



Discover fun and games at XtraMSN Kids!

--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: RE: exception handling in OPS

Erik Bruchez
Administrator
In reply to this post by achai277
Unless I am mistaken, the Servlet API tells you that either:

1. You throw an exception (ServletException or IOException or
    RuntimeException) from your servlet.

2. You call sendError() with an error message.

Both cases can be caught from error pages set in web.xml.

OPS will run the custom error pipeline if it exists and otherwise send
the exception directly to the client. When that happens, a
SC_INTERNAL_SERVER_ERROR (code 500) is set on the response, assuming
the response has not yet been "committed" as per the Servlet spec.

So you should be able to catch code 500 from your servlet API. The
exception will however not be propagated, but note that OPS will log
the exception to its log file.

If that doesn't work, try, in your web.xml, under ops-main-servlet, to
comment out these lines:

<init-param>
     <param-name>oxf.error-processor.name</param-name>
 
<param-value>{http://www.orbeon.com/oxf/processors}pipeline</param-value>
</init-param>
<init-param>
     <param-name>oxf.error-processor.input.config</param-name>
     <param-value>oxf:/config/error.xpl</param-value>
</init-param>

This will disable the custom error processor.

-Erik

[hidden email] wrote:

 > In response to the first message, I would like to know if it's
 > possible to bypass the error pipeline and let the exception
 > propogate up to the error handler declared in web.xml? This is what
 > we would like to achieve, else we will have to maintain two
 > redirections: one in web.xml and the other in an orbeon error
 > pipeline - it would be best if we could avoid this.

--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws