Sep 6, 2018 · 1 min read
Hi, in your getMessage anonymous function example
val getMessage = fun(response: Response): String {
if(response.code !in 200..299) {
return "Error" // Error! Not allowed
}
return response.message
}Why the first return wouldn’t work? To me this seems like a perfectly working example. It should return either “Error” or the message string in response.message