Commit 216cc9ef authored by Mygod's avatar Mygod

Refine #574

parent 3bb74625
......@@ -2,17 +2,16 @@ package com.github
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import scala.util.{Success, Failure, Try}
import scala.util.{Failure, Try}
/**
* @author Mygod
*/
package object shadowsocks {
val handleFailure: PartialFunction[Try[_], Unit] = {
case Success(_) =>
private val handleFailure: Try[_] => Unit = {
case Failure(e) => e.printStackTrace()
case _ =>
}
def ThrowableFuture[T](f: => T) = Future(f) onComplete handleFailure
}
\ No newline at end of file
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment