我希望我的 Grails Web 应用程序为到达最终用户的每个异常发送一封电子邮件。
基本上我正在寻找一种优雅的方式来实现相当于:
try {
// ... all logic/db-access/etc required to render the page is executed here ...
}
catch (Exception e) {
sendmail("exception@example.com", "An exception was thrown while processing a http-request", e.toString);
}