I recently came across the concept of Try
/Success
/Failure
, and I am wondering how to use it for a method that has the return type Unit
. Is using Try[Unit]
the correct way? Maybe I am too influenced from my Java background, but is it a good idea to force the caller to deal with the problem?
相关问题
- Unusual use of the new keyword
- Get Runtime Type picked by implicit evidence
- What's the point of nonfinal singleton objects
- PlayFramework: how to transform each element of a
- Error in Scala Compiler: java.lang.AssertionError:
相关文章
- Gatling拓展插件开发,check(bodyString.saveAs("key"))怎么实现
- RDF libraries for Scala [closed]
- Why is my Dispatching on Actors scaled down in Akk
- How do you run cucumber with Scala 2.11 and sbt 0.
- GRPC: make high-throughput client in Java/Scala
- <link> onerror do not work in IE
- Setting up multiple test folders in a SBT project
- Could not find default endpoint element that refer
Try[Unit]
is normal. For example, if you persist the entity, you can use:or just