com.colisweb.zio.gdrive.client.Retry.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of google-drive-scala-client-zio_2.13 Show documentation
Show all versions of google-drive-scala-client-zio_2.13 Show documentation
Google Drive Scala Client is a Scala wrapper around the Google Drive client for Java
The newest version!
package com.colisweb.zio.gdrive.client
import zio.{Schedule, Task, ZIO}
class Retry(retryPolicy: Schedule[Any, Throwable, Any]) {
def apply[A](computation: => A): Task[A] =
ZIO
.attempt(computation)
.tapError(e => ZIO.logWarning(s"error occurred in google-drive-scala : ${e.toString}"))
.retry(retryPolicy)
}