question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Caused by: com.github.kittinunf.fuel.core.HttpException: HTTP Exception 404 Not Found

See original GitHub issue

i got error in httppost… plase help

 @SuppressLint("ShowToast")
    private fun getData(npa: String) {
        progressbar.visibility = View.VISIBLE
        val json = JSONObject()
        json.put("npa", npa)
        try {
            NPA.httpPost(listOf("npa" to npa))
                    .header()
                    .timeout(5000)
                    .timeoutRead(60000)
                    .responseString { _, response, result ->
                        progressbar.visibility = View.GONE
                        when (result) {
                            is Result.Failure -> {
                                Log.d("hasil gagal", result.get())
                            }
                            is Result.Success -> {
                                try {
                                    Log.d("hasil sukses", result.get())
                                }catch (e: HttpException) {
                                    Log.d("hasil gagal", result.get())
                                }
                            }

                        }
                    }
        } catch (e: HttpException) {
        }
    }

this the error

06-14 19:14:37.041 17102-17102/com.gentasoft.pdgikabpasuruan E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.gentasoft.pdgikabpasuruan, PID: 17102
    java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
     Caused by: java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794) 
     Caused by: com.github.kittinunf.fuel.core.HttpException: HTTP Exception 404 Not Found
        at com.github.kittinunf.fuel.core.interceptors.ValidatorInterceptorKt$validatorResponseInterceptor$1$1.invoke(ValidatorInterceptor.kt:12)
        at com.github.kittinunf.fuel.core.interceptors.ValidatorInterceptorKt$validatorResponseInterceptor$1$1.invoke(ValidatorInterceptor.kt)
        at com.github.kittinunf.fuel.core.interceptors.RedirectionInterceptorKt$redirectResponseInterceptor$1$1.invoke(RedirectionInterceptor.kt:35)
        at com.github.kittinunf.fuel.core.interceptors.RedirectionInterceptorKt$redirectResponseInterceptor$1$1.invoke(RedirectionInterceptor.kt)
        at com.github.kittinunf.fuel.core.requests.TaskRequest.call(TaskRequest.kt:16)
        at com.github.kittinunf.fuel.core.requests.AsyncTaskRequest.call(AsyncTaskRequest.kt:11)
        at com.github.kittinunf.fuel.core.requests.AsyncTaskRequest.call(AsyncTaskRequest.kt:6)
        at java.util.concurrent.FutureTask.run(FutureTask.java:237)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:760)
     Caused by: com.github.kittinunf.fuel.core.HttpException: HTTP Exception 404 Not Found
        at com.github.kittinunf.fuel.core.interceptors.ValidatorInterceptorKt$validatorResponseInterceptor$1$1.invoke(ValidatorInterceptor.kt:12) 
        at com.github.kittinunf.fuel.core.interceptors.ValidatorInterceptorKt$validatorResponseInterceptor$1$1.invoke(ValidatorInterceptor.kt) 
        at com.github.kittinunf.fuel.core.interceptors.RedirectionInterceptorKt$redirectResponseInterceptor$1$1.invoke(RedirectionInterceptor.kt:35) 
        at com.github.kittinunf.fuel.core.interceptors.RedirectionInterceptorKt$redirectResponseInterceptor$1$1.invoke(RedirectionInterceptor.kt) 
        at com.github.kittinunf.fuel.core.requests.TaskRequest.call(TaskRequest.kt:16) 
        at com.github.kittinunf.fuel.core.requests.AsyncTaskRequest.call(AsyncTaskRequest.kt:11) 
        at com.github.kittinunf.fuel.core.requests.AsyncTaskRequest.call(AsyncTaskRequest.kt:6) 
        at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) 
        at java.lang.Thread.run(Thread.java:760) 

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
markGilchristcommented, Jul 5, 2018

@congfandi try changing

} catch (e: HttpException) { }

to

} catch (e: FuelError) { }
0reactions
markGilchristcommented, Jul 18, 2018

@congfandi is this resolved? can we close this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Caused by: com.github.kittinunf.fuel.core.HttpException: HTTP ...
i got error in httppost.. plase help @SuppressLint("ShowToast") private fun getData(npa: String) { progressbar.visibility = View.
Read more >
Cannot see error message in http response in Kotlin Fuel
FuelError$Companion.wrap(FuelError.kt:86) Caused by: com.github.kittinunf.fuel.core.HttpException: HTTP Exception 400 Bad Request ...
Read more >
Why am I getting an error code of 400 with Fuel? : r/Kotlin
FuelError$Companion.wrap(FuelError.kt:86) Caused by: com.github.kittinunf.fuel.core.HttpException: HTTP Exception 400 Bad Request ...
Read more >
Bitbucket Server or Data Center displays a 404 error when ...
In this case, either the Database or the Filesystem (git repositories on the Shared home folder) will be out of sync causing orphaned...
Read more >
v1.x.y - Fuel - Documentation - GitBook
The easiest HTTP networking library for Kotlin/Android. ... compile 'com.github.kittinunf.fuel:fuel-gson:<latest-version>' //for Gson support.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found