File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
core/src/main/scala/sttp/monad Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ project/plugins/project/
1717.worksheet
1818
1919.idea *
20+ .vscode
2021
2122.keys *
2223
@@ -28,6 +29,6 @@ lowered.hnir
2829# Bloop / Metals
2930.bloop /
3031.metals /
31- project / metals.sbt
32+ metals.sbt
3233
3334.bsp
Original file line number Diff line number Diff line change @@ -23,10 +23,10 @@ trait MonadError[F[_]] {
2323 def error [T ](t : Throwable ): F [T ]
2424 protected def handleWrappedError [T ](rt : F [T ])(h : PartialFunction [Throwable , F [T ]]): F [T ]
2525 def handleError [T ](rt : => F [T ])(h : PartialFunction [Throwable , F [T ]]): F [T ] = {
26- Try (rt) match {
27- case Success (v) => handleWrappedError(v)(h)
28- case Failure (e) if h.isDefinedAt(e) => h(e)
29- case Failure (e) => error(e)
26+ try handleWrappedError (rt)(h)
27+ catch {
28+ case e : Throwable if h.isDefinedAt(e) => h(e)
29+ case e : Throwable => error(e)
3030 }
3131 }
3232
You can’t perform that action at this time.
0 commit comments