https://kotlinlang.org logo
d

David Marin

02/25/2021, 8:12 AM
Hi guys, I need to report parsing errors on the body of a retrofit request to our crash reporting tools (as handled exceptions). The problem is that I would need the url we are hitting too, and I do not see how I can get the real one with its parameters, The best I can get is:
Copy code
to.hopin.android.core.exceptions.DecodeNetworkException: Couldn't decode response from /api/v2/events/{eventId}/locale
        at to.hopin.android.core.moshi.ErrorAwareMoshiResponseBodyConverter.convert(ErrorAwareMoshiConverterFactory.kt:69)
        at to.hopin.android.core.moshi.ErrorAwareMoshiResponseBodyConverter.convert(ErrorAwareMoshiConverterFactory.kt:60)
        at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:243)
        at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:153)
        at com.google.firebase.perf.network.InstrumentOkHttpEnqueueCallback.onResponse(InstrumentOkHttpEnqueueCallback.java:69)
        at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)
     Caused by: com.squareup.moshi.JsonDataException: com.squareup.moshi.JsonDataException: Expected a name but was NULL at path $.custom_text at $.custom_text
        at com.squareup.moshi.AdapterMethodsFactory$1.fromJson(AdapterMethodsFactory.java:101)
        at retrofit2.converter.moshi.MoshiResponseBodyConverter.convert(MoshiResponseBodyConverter.java:46)
        at retrofit2.converter.moshi.MoshiResponseBodyConverter.convert(MoshiResponseBodyConverter.java:27)
        at to.hopin.android.core.moshi.ErrorAwareMoshiResponseBodyConverter.convert(ErrorAwareMoshiConverterFactory.kt:66)
        at to.hopin.android.core.moshi.ErrorAwareMoshiResponseBodyConverter.convert(ErrorAwareMoshiConverterFactory.kt:60) 
        at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:243) 
        at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:153) 
        at com.google.firebase.perf.network.InstrumentOkHttpEnqueueCallback.onResponse(InstrumentOkHttpEnqueueCallback.java:69) 
        at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:919) 
     Caused by: com.squareup.moshi.JsonDataException: Expected a name but was NULL at path $.custom_text
Any ideas?
3 Views