Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: 2.0-M1
-
Fix Version/s: 2.0-M2
-
Component/s: Controllers
-
Labels:None
Description
If an exception is thrown from within my request handling I get a poor message at the console. For instance consider the following controller action:
def testErrorReporting = {
throw new Exception("Test exception")
}
When invoked that gives the following in the console (I'm using grails interactive mode), which doesn't include the original exception type or message, nor a line number for where it was thrown. The error shown in the browser does include those things.
Error 2011-08-11 17:42:13,917 ["http-bio-8080"-exec-5] ERROR errors.GrailsExceptionResolver - Exception occurred when processing request: [GET] /LunchApp20T2/week/testErrorReporting
Stacktrace follows:
Line | Method
->> 37 | doCall in com.softwire.lunchapp.WeekController$_closure3$$EN7Hlm1g
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
886 runTask in java.util.concurrent.ThreadPoolExecutor$Worker 908 run . . in ''
^ 680run in java.lang.Thread
Can you attach an example? From a controller with an action like:
class FooController { def index() { throw new Exception("Bad") } }I get:
Stacktrace follows: Line | Method ->> 6 | index in sec.demo.FooController$$EN7qBjRA - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker | 908 | run . . in '' ^ 680 | run in java.lang.Thread