Grails

Better error message for save(failOnError:true)

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 1.2-M2
  • Fix Version/s: 1.2-M4
  • Component/s: Persistence
  • Labels:
    None

Description

This is a follow-up issue to: GRAILS-4343
domain.save(failOnError:true)

The fail-fast concept works, but the message isn't very helpful at the moment.
All you get is a general error message, like:

 
Caused by: grails.validation.ValidationException: Validation Error(s) Occurred During Save
	at BootStrap$_closure1.doCall(BootStrap.groovy:13)
	... 33 more

You still need debug or handle the code by your own to know which constraint failed.

It would be much more helpful, if the fail-fast error message includes the detail of validation errors.

Please include the errors-object messages into the exception. Thanks!

Issue Links

Activity

Hide
Jeff Brown added a comment -

Are you asking for ValidationException to have a copy of the errors? Are you asking for details about the validation failures to be in the exception message? Both?

Please clarify.

Show
Jeff Brown added a comment - Are you asking for ValidationException to have a copy of the errors? Are you asking for details about the validation failures to be in the exception message? Both? Please clarify.
Hide
Mos added a comment -

> Are you asking for details about the validation failures to be in the exception message?

Yes, that's what I asking for.

Sure, it would be also nice if the ValidationException includes a copy of the errors additionally, or even better a reference to the failed domain/command object,. --> "Both?"

Show
Mos added a comment - > Are you asking for details about the validation failures to be in the exception message? Yes, that's what I asking for. Sure, it would be also nice if the ValidationException includes a copy of the errors additionally, or even better a reference to the failed domain/command object,. --> "Both?"

People

Vote (2)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: