Grails validation error from service method
-
29-10-2019 - |
Вопрос
I have a method in a service class that creates an object:
def createContent (fileName, description) {
def content = new Content(
fileName:fileName,
description:description,
).save()
}
Neither of those properties are nullable. How can I pass the validation errors back to be displayed? I've tried flash.message and render, both of which don't work from within service classes. I also tried .save(failOnError:true) which displayed a long list of errors.
Нет правильного решения
Не связан с StackOverflow