is there a way to get Spring web to return a 404 i...
# spring
f
is there a way to get Spring web to return a 404 if my controller returns an
Optional
that is not present?
c
Probably you'll need to write a message convertor. This really isn't a Kotlin question though, head to stackoverflow
f
yeah I tried searching Google/StackOverflow but couldn't find anything relating to responses, I'll have a look at message converters, thx
c
StackOverflow is not only for searching for answers but also for asking for them 😉
1
👍 2
r
Unsolicited advice: it'd be much easier and IMHO better modeling to map a suitable exception to a 404