Answer the question
In order to leave comments, you need to log in
How to find out the exception contract for a method in Scala?
I wrote in Objective-C for a long time. All methods that can fail have (one way or another) a reference to an NSError object. Which carries information about the location of the error, its code and payload (such as a message, etc.).
Lately I've been writing in Scala and I have a question about exceptions.
As you know, Future can either complete successfully or with an exception.
Play WS has a method def get(): Future[WSResponse]
The semantics of the WSResponse object is quite clear, it's an HTTP response. But what if there was a network or some other error? That's right - Future will fail as a Throwable.
How can I understand what exceptions to expect in order to correctly apply pattern matching in the recover method? I understand that Scala should avoid exceptions and use the type system as much as possible. But there are still exceptions, and for example, it WS.url("http://null").get
will return java.net.ConnectException.
Answer the question
In order to leave comments, you need to log in
https://developer.android.com/topic/libraries/data...
Here is about using MVVM.
https://habrahabr.ru/company/mobileup/blog/312548/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question