Scala-weather issues


#1

Hi i am using your scala-weather api ,
i have succesfuly compiled with dependencies , but my code is having some errors ,

src/main/scala/Main.scala:10: type mismatch;
[error] found : scalaz./[com.snowplowanalytics.weather.providers.openweather.Errors.WeatherError,com.snowplowanalytics.weather.providers.openweather.Responses.Current] => Unit
[error] required: PartialFunction[scalaz./[com.snowplowanalytics.weather.providers.openweather.Errors.WeatherError,com.snowplowanalytics.weather.providers.openweather.Responses.Current],?]
[error] response.onSuccess { weather =>
[error] ^
[error] one error found
[error] (compile:compileIncremental) Compilation failed
[error] Total time: 4 s, completed Jul 20, 2017 7:50:46 PM


Code

import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.{ Await, Future }
import com.snowplowanalytics.weather.providers.openweather.OwmAsyncClient
object Main extends App {
val client = OwmAsyncClient(“key”)
val response = client.currentByCoords(35, 139)

response.onSuccess { weather =>
println(weather)
}
}


#2

I am running into same issue… looking for answer on this …


#3

I’m assuming you’re running version 0.2.0:

response.onSuccess {
  case -\/(weatherError) => println(weatherError)
  case \/-(response)       => println(response)
}

If you upgrade to 0.3.0:

response.onSuccess {
  case Left(weatherError) => println(weatherError)
  case Right(response)    => println(response)
}