Dear Wiki user, You have subscribed to a wiki page or wiki category on "Tapestry Wiki" for change notification.
The "Tapestry5HowToSendErrorPageAsEmail" page has been changed by WulfWechsung: http://wiki.apache.org/tapestry/Tapestry5HowToSendErrorPageAsEmail?action=diff&rev1=3&rev2=4 Like the extensive and verbose error output of tapestry development mode? Don't want to scare your users away with the page? Want to be notified when your users run into trouble? + + This recipe is adapted from the official documentation (http://tapestry.apache.org/overriding-exception-reporting.html) + === App Module === integrate this into your app module: @@ -47, +50 @@ String errorTrackId = System.currentTimeMillis() + ""; + /** render the full exception page **/ - Document v = generator.render(exceptionPage); + Document devOutput = generator.render(exceptionPage); /** send email here **/ + - // this is a custom email builder so you'll have to substitute your own email sending code + /** this is a custom email builder so you'll have to substitute your own email sending code Email.from(sender).to(rcpt).withSubject("Error occured [tracking id=%s]", errorTrackId) - .withContent("text/html", v.toString()).finish().sendVia(emailserver); + .withContent("text/html", devOutput.toString()).finish().sendVia(emailserver); + **/ + + /** Show your custom, user friendly page **/ + /** - /** In the original scenario I would show the tracker-id on the userfriendly error page + * In the original scenario I would show the tracker-id on the user-friendly error page + * Component userfiendly = componentSource.getPage(userfriendly); - ((ErrorTracker) userfiendly).setErrorID(errorTrackId); + *((ErrorTracker) userfiendly).setErrorID(errorTrackId); **/ - Component userfiendly = componentSource.getPage(userfriendly); + responseRender.renderPageMarkupResponse(userfriendly); } catch (Throwable t) { --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
