For cases where "myKey" cannot be found, the future returned from atomicallyUpdate returns a failed future with
ClassCastException: scala.concurrent.impl.Promise$KeptPromise cannot be cast to MyData
It would be useful if the failed future indicated the not found status instead. I'm thinking of cases where I'm providing a RESTful service and want to return a 404 Not Found status. Since a ClassCastException could be thrown for other reasons, it's difficult to discern when it's truly a casting issue or a not found issue.
For cases where "myKey" cannot be found, the future returned from atomicallyUpdate returns a failed future with
It would be useful if the failed future indicated the not found status instead. I'm thinking of cases where I'm providing a RESTful service and want to return a
404 Not Found
status. Since aClassCastException
could be thrown for other reasons, it's difficult to discern when it's truly a casting issue or a not found issue.Thanks.