Open Kerruba opened 7 years ago
The message is quite detailed:
java.lang.IllegalStateException: Expected to find link with rel 'foo' in response {
"_links" : {
"items" : {
"href" : "http://localhost:52758/springagram/items{?projection}",
"templated" : true
},
"profile" : {
"href" : "http://localhost:52758/springagram/alps"
}
}
}
!
Are you suggesting you want to trap this type of exception across the framework? Because that sounds like an API adjustment to define a new exception for this condition.
I wanted to get @olivergierke 's opinion on this. It would appear to generate a more typesafe manner of no link being found. But since this is exception handler, it also promotes using exceptions for controls.
I have attached a commit on an experimental branch.
Yeah I would say this way the exception is more context related. Thanks
At the moment an IllegalStateException is thrown when traverson doesn't find a link with the rel you specified. What about provide a more meaningful exception, like LinkNotFoundException or similar?