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
When an exception is thrown in a request interceptor, that runtime exception bubbles up until the point that it is assumed (inside of of fuel code) to be a FuelError, is unsafe cast as one, and causes a runtime error at the failed cast.
class java.lang.RuntimeException cannot be cast to class com.github.kittinunf.fuel.core.FuelError (java.lang.RuntimeException is in module java.base of loader 'bootstrap'; com.github.kittinunf.fuel.core.FuelError is in unnamed module of loader 'app')
Instead of throwing the expected RuntimeException wrapped in a FuelError.
Expected behavior
All non-FuelErrors should be wrapped in a FuelError and be handleable as FuelErrors in the request would be, and not have the failed cast.
.recover {
if (it isFuelError) Result.Failure(it asFuelError)
elseResult.Failure(FuelError.wrap(it))
}
However I can't seem to get Fuel building locally because of "SDK location not found" at "build.gradle.kts:130" despite having the same JDK 11 set up that I use for everything else. So either feel free to crib that if it makes sense or any direction on how to set up a local build would be great and I'd put up a PR with a test immediately.
Thanks!
The text was updated successfully, but these errors were encountered:
Bug Report
Description
When an exception is thrown in a request interceptor, that runtime exception bubbles up until the point that it is assumed (inside of of fuel code) to be a
FuelError
, is unsafe cast as one, and causes a runtime error at the failed cast.To Reproduce
Simple code to recreate:
Will throw error:
Instead of throwing the expected
RuntimeException
wrapped in aFuelError
.Expected behavior
All non-FuelErrors should be wrapped in a FuelError and be handleable as FuelErrors in the request would be, and not have the failed cast.
Screenshots
N/A
Environment
Development Machine
Smartphone or Emulator
N/A
Additional context
The error is right here:
fuel/fuel/src/main/kotlin/com/github/kittinunf/fuel/core/requests/SuspendableRequest.kt
Line 58 in 105d311
It seems as simple as changing this to:
However I can't seem to get Fuel building locally because of "SDK location not found" at "build.gradle.kts:130" despite having the same JDK 11 set up that I use for everything else. So either feel free to crib that if it makes sense or any direction on how to set up a local build would be great and I'd put up a PR with a test immediately.
Thanks!
The text was updated successfully, but these errors were encountered: