Care to outline how you would expect this to happen in Java?
Kristian R.
41

Hey Kristian. That’s a good point. One way to do this is to encapsulate the possible error/success states in a Response<Data> object. This way, the consumer will can check whether there is an error before trying to access the data. Here’s a good example: https://github.com/square/retrofit/blob/master/retrofit/src/main/java/retrofit2/Response.java

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.