Grails 7 - Overly Verbose Exceptions
- Dominant language
- Groovy
- Stars
- 2.9k
- Forks
- 975
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 92
Description
### Expected Behavior
Exceptions can quickly overwhelm the logs with redundant information. Here is an example where
`at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)` occurs 10 times in the trace but serves no useful purpose.
GrailsExceptionResolver should be updated to squelch situations like this.
```
...
at org.grails.datastore.mapping.mongo.MongoCodecSession.flush(MongoCodecSession.groovy:234)
at org.grails.datastore.mapping.mongo.AbstractMongoSession.flush(AbstractMongoSession.java:73)
at org.grails.datastore.gorm.GormInstanceApi.doSave(GormInstanceApi.groovy:368)
at org.grails.datastore.gorm.GormInstanceApi$_save_closure5.doCall(GormInstanceApi.groovy:180)
at org.grails.datastore.mapping.core.DatastoreUtils.execute(DatastoreUtils.java:333)
at org.grails.datastore.gorm.AbstractDatastoreApi.execute(AbstractDatastoreApi.groovy:40)
at org.grails.datastore.gorm.GormInstanceApi.save(GormInstanceApi.groovy:179)
at org.grails.datastore.gorm.GormEntity$Trait$Helper.save(GormEntity.groovy:153)
at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
at com.example.grails.mongo.GormMongoService.$tt__gormMongoService_save(GormMongoService.groovy:61)
at grails.gorm.transactions.GrailsTransactionTemplate$2.doInTransaction(GrailsTransactionTemplate.groovy:94)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
at grails.gorm.transactions.GrailsTransactionTemplate.execute(GrailsTransactionTemplate.groovy:91)
at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
at com.example.image.UserCategoryService.setUserCategory(UserCategoryService.groovy:156)
at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
at com.example.image.UserCategoryService.incrementUserCategoryHelper(UserCategoryService.groovy:137)
at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
at com.example.image.UserCategoryService.incrementUserCategory(UserCategoryService.groovy:120)
at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
at com.example.image.SampleService.releaseSample(SampleService.groovy:188)
at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
at com.example.image.SampleController$_send_closure5$_closure36$_closure37.doCall(SampleController.groovy:147)
at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
at com.example.image.SampleController$_send_closure5$_closure36.doCall(SampleController.groovy:146)
at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
at com.example.image.SampleController$_send_closure5.doCall(SampleController.groovy:142)
at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
at com.example.image.SampleController.send(SampleController.groovy:137)
```
### Actual Behaviour
_No response_
### Steps To Reproduce
_No response_
### Environment Information
_No response_
### Example Application
_No response_
### Version
7.0.0-M2
Contributor guide
Research direction
Start by locating GrailsExceptionResolver and reading how it formats exception stack traces. Use the repeated IndyInterface.fromCache frames in the issue as the behavior to investigate. Done means redundant repeated frames are removed from the resulting trace without obscuring useful application frames.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- groovy
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100