Re: Log last error on error page
The easiest I can think of is to override org.apache.wicket.RequestCycle.onRuntimeException(Page, RuntimeException) and return your own page which will show the error On Tue, Nov 23, 2010 at 2:43 PM, Brown, Berlin [GCG-PFS] berlin.br...@primerica.com wrote: Is there a way to log the last error when you reach an error page. I am using my own error page but also want to log the last stack trace or exception message that created the error. getApplicationSettings().setInternalErrorPage(ErrorPage.class); Berlin Brown
RE: Log last error on error page
Another question, how do I throw the default error page? So with that request, log the exception: public final class MyRequestCycle extends WebRequestCycle { public WebRequestCycle(final WebApplication application, final WebRequest request, final Response response) { super(application, request, response); } /** * {...@inheritdoc} */ @Override protected final Page onRuntimeException(final Page cause, final RuntimeException e) { // And then catch the exception LOG.error(e); return new MyExceptionPage(e); } } -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Tuesday, November 23, 2010 9:05 AM To: users@wicket.apache.org Subject: Re: Log last error on error page The easiest I can think of is to override org.apache.wicket.RequestCycle.onRuntimeException(Page, RuntimeException) and return your own page which will show the error On Tue, Nov 23, 2010 at 2:43 PM, Brown, Berlin [GCG-PFS] berlin.br...@primerica.com wrote: Is there a way to log the last error when you reach an error page. I am using my own error page but also want to log the last stack trace or exception message that created the error. getApplicationSettings().setInternalErrorPage(ErrorPage.class); Berlin Brown - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Log last error on error page
On Tue, Nov 23, 2010 at 3:18 PM, Brown, Berlin [GCG-PFS] berlin.br...@primerica.com wrote: Another question, how do I throw the default error page? what does it mean to throw a page ? So with that request, log the exception: public final class MyRequestCycle extends WebRequestCycle { public WebRequestCycle(final WebApplication application, final WebRequest request, final Response response) { super(application, request, response); } /** * {...@inheritdoc} */ @Override protected final Page onRuntimeException(final Page cause, final RuntimeException e) { // And then catch the exception LOG.error(e); return new MyExceptionPage(e); } } -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Tuesday, November 23, 2010 9:05 AM To: users@wicket.apache.org Subject: Re: Log last error on error page The easiest I can think of is to override org.apache.wicket.RequestCycle.onRuntimeException(Page, RuntimeException) and return your own page which will show the error On Tue, Nov 23, 2010 at 2:43 PM, Brown, Berlin [GCG-PFS] berlin.br...@primerica.com wrote: Is there a way to log the last error when you reach an error page. I am using my own error page but also want to log the last stack trace or exception message that created the error. getApplicationSettings().setInternalErrorPage(ErrorPage.class); Berlin Brown - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Log last error on error page
Is there an instance of the Default Internal Error page or should I return null in te onRuntimeException method? ... return new MyExceptionPage(e); Replace with return new org.apache.wicket.page.InternalErrorPage(e); -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Tuesday, November 23, 2010 9:28 AM To: users@wicket.apache.org Subject: Re: Log last error on error page On Tue, Nov 23, 2010 at 3:18 PM, Brown, Berlin [GCG-PFS] berlin.br...@primerica.com wrote: Another question, how do I throw the default error page? what does it mean to throw a page ? So with that request, log the exception: public final class MyRequestCycle extends WebRequestCycle { public WebRequestCycle(final WebApplication application, final WebRequest request, final Response response) { super(application, request, response); } /** * {...@inheritdoc} */ @Override protected final Page onRuntimeException(final Page cause, final RuntimeException e) { // And then catch the exception LOG.error(e); return new MyExceptionPage(e); } } -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Tuesday, November 23, 2010 9:05 AM To: users@wicket.apache.org Subject: Re: Log last error on error page The easiest I can think of is to override org.apache.wicket.RequestCycle.onRuntimeException(Page, RuntimeException) and return your own page which will show the error On Tue, Nov 23, 2010 at 2:43 PM, Brown, Berlin [GCG-PFS] berlin.br...@primerica.com wrote: Is there a way to log the last error when you reach an error page. I am using my own error page but also want to log the last stack trace or exception message that created the error. getApplicationSettings().setInternalErrorPage(ErrorPage.class); Berlin Brown - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Log last error on error page
On Tue, Nov 23, 2010 at 3:18 PM, Brown, Berlin [GCG-PFS] berlin.br...@primerica.com wrote: Another question, how do I throw the default error page? You cause an error and press the print button. You walk to your printer and get the printout. Now you have two options: 1. cram it together into a little ball 2. find a blue-print for a paper airplane and fold it according to the instructions Go to a nice spot (preferably high) and throw the paper object you created from the error page in the previous step. It is a really fun exercise, and I encourage anyone to do this at least once a month. Note that this is not just limited to the default Wicket error page (although those can be really fun), but you can do this also for bug reports or email messages. Just make sure you don't throw around confidential information. Martijn - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Log last error on error page
just return null and the default logic will be applied depending on your IExceptionSettings On Tue, Nov 23, 2010 at 3:31 PM, Brown, Berlin [GCG-PFS] berlin.br...@primerica.com wrote: Is there an instance of the Default Internal Error page or should I return null in te onRuntimeException method? ... return new MyExceptionPage(e); Replace with return new org.apache.wicket.page.InternalErrorPage(e); -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Tuesday, November 23, 2010 9:28 AM To: users@wicket.apache.org Subject: Re: Log last error on error page On Tue, Nov 23, 2010 at 3:18 PM, Brown, Berlin [GCG-PFS] berlin.br...@primerica.com wrote: Another question, how do I throw the default error page? what does it mean to throw a page ? So with that request, log the exception: public final class MyRequestCycle extends WebRequestCycle { public WebRequestCycle(final WebApplication application, final WebRequest request, final Response response) { super(application, request, response); } /** * {...@inheritdoc} */ @Override protected final Page onRuntimeException(final Page cause, final RuntimeException e) { // And then catch the exception LOG.error(e); return new MyExceptionPage(e); } } -Original Message- From: Martin Grigorov [mailto:mgrigo...@apache.org] Sent: Tuesday, November 23, 2010 9:05 AM To: users@wicket.apache.org Subject: Re: Log last error on error page The easiest I can think of is to override org.apache.wicket.RequestCycle.onRuntimeException(Page, RuntimeException) and return your own page which will show the error On Tue, Nov 23, 2010 at 2:43 PM, Brown, Berlin [GCG-PFS] berlin.br...@primerica.com wrote: Is there a way to log the last error when you reach an error page. I am using my own error page but also want to log the last stack trace or exception message that created the error. getApplicationSettings().setInternalErrorPage(ErrorPage.class); Berlin Brown - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org