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

tanukkii.reactivezk.KeeperExceptionConverter.scala Maven / Gradle / Ivy

package tanukkii.reactivezk

import org.apache.zookeeper.KeeperException
import org.apache.zookeeper.KeeperException.Code

trait KeeperExceptionConverter {
  implicit class ToKeeperException(code: Int) {
    def toKeeperExceptionOpt(path: String): Option[KeeperException] = {
      if (Code.get(code) == Code.OK) None
      else Some(KeeperException.create(Code.get(code), path))
    }
  }
}

object KeeperExceptionConverter extends KeeperExceptionConverter




© 2015 - 2024 Weber Informatics LLC | Privacy Policy