You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tryWith should return Try instead of return a result or throwing an exception.
The current tryWith returns the direct result or throws an exception.
// result is what resource.doSomething() returns// or if anything goes wrong, it may throw an exception.valresult= tryWith(someCloseable) { resource =>
resource.doSomething()
}
It needs to use Try instead of dealing directly with an exception or the result.
// result is either Success[T] where T is the type of the value resource.doSomething() returns// or Failure containing an exception (Throwable) if the exception was thrown.valresult= tryWith(someCloseable) { resource =>
resource.doSomething()
}
The text was updated successfully, but these errors were encountered:
tryWith
should returnTry
instead of return a result or throwing an exception.The current
tryWith
returns the direct result or throws an exception.It needs to use
Try
instead of dealing directly with an exception or the result.The text was updated successfully, but these errors were encountered: