https://kotlinlang.org logo
#arrow
Title
s

simon.vergauwen

04/26/2019, 8:23 AM
Copy code
Try {
  val containerURL = serviceURL.createContainerURL(containerName)
  val response = containerURL.create().blockingGet()
  containerURL
}.handleErrorWith { error ->
  if (error is RestException && error.response().statusCode() != Conflict.value) Try.raiseError(UnableToCreateStorageContainer())
  else Try.raiseError(error)
}