Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 39870 invoked from network); 13 Jun 2002 20:15:16 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 13 Jun 2002 20:15:16 -0000 Received: (qmail 26850 invoked by uid 97); 13 Jun 2002 20:14:49 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 26737 invoked by uid 97); 13 Jun 2002 20:14:48 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 26599 invoked by uid 98); 13 Jun 2002 20:14:47 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Message-ID: From: Subir Sengupta To: 'Tomcat Users List' Subject: Update: Exception Handling Date: Thu, 13 Jun 2002 13:15:55 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="ISO-8859-1" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N I started looking at the stacktrace and reading the code. It seems that ErrorReportValve class is responsible for trapping throwable and creating the report that is sent to the browser. So I made a copy and renamed it to WMErrorReportValve and attached a Valve element at the Host level. This seemed to work since now when I throw an exception I see WMErrorReportVavle in the stacktrace and not ErrorReportValve. Can anyone confirm that this is the correct way to handle exceptions, since this valve isn't documented anywhere. Thanks, Subir -----Original Message----- From: Subir Sengupta [mailto:subir@walmart.com] Sent: Wednesday, June 12, 2002 3:49 PM To: 'tomcat-user@jakarta.apache.org' Subject: Exception Handling Hi, I'd like to be able to trap all exceptions and show users a friendly error page. I know I can specify which exception to trap in the web.xml file and what error pages to display. But it seems that will only trap exceptions that I specify and let any other exceptions through! So that doesn't seem like a very practical way to deal with exceptions. When an exception is thrown, Tomcat prints the stacktrace to the browser. Is there a way to hook into this mechanism and have Tomcat display an error page instead. Also I'd like to have an email with the exception sent to me. There may already be a way to do this that I don't know about. Any pointers are appreciated. I'm using Tomcat 4.0.3 on linux. -- To unsubscribe, e-mail: For additional commands, e-mail: -- To unsubscribe, e-mail: For additional commands, e-mail: