我希望我的Grails网络应用程序能够为每个到达最终用户的异常发送电子邮件.
基本上我正在寻找一种优雅的方式来实现相当于:
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);
}
Run Code Online (Sandbox Code Playgroud)