All Downloads are FREE. Search and download functionalities are using the official Maven repository.

izumi.fundamentals.platform.integration.ResourceCheck.scala Maven / Gradle / Ivy

package izumi.fundamentals.platform.integration

import izumi.fundamentals.platform.exceptions.IzThrowable._

sealed trait ResourceCheck

object ResourceCheck {

  final case class Success() extends ResourceCheck

  sealed trait Failure extends ResourceCheck

  final case class ResourceUnavailable(description: String, cause: Option[Throwable]) extends Failure {
    override def toString: String = {
      cause match {
        case Some(t) =>
          s"Unavailable resource: $description, ${t.getClass}: ${t.stacktraceString}"

        case None =>
          s"Unavailable resource: $description"

      }
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy