改造投掷和转换'其中一个回复的错误

时间:2016-03-02 11:15:20

标签: android retrofit

我使用Retrofit获取数据,
在同步请求中,我收到代码200的响应,但是当它使用我的模型类进行反序列化时,它会抛出一个错误,问题是对于一个输入/响应它会解析数据,而对于另一个输入/响应(来自同一API)会抛出CONVERSION类型错误。

我不明白导致CONVERSION错误的原因。

打印堆栈跟踪后,我得到了 -

Sample-ProjectErrorHandler: conversion error
03-02 14:35:50.054 17161-17161/com.discover.Sample-Project W/System.err: retrofit.RetrofitError: Please try in few minutes
03-02 14:35:50.064 17161-17161/com.discover.Sample-Project W/System.err:     at retrofit.CallbackRunnable.run(CallbackRunnable.java:50)
03-02 14:35:50.064 17161-17161/com.discover.Sample-Project W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
03-02 14:35:50.064 17161-17161/com.discover.Sample-Project W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
03-02 14:35:50.064 17161-17161/com.discover.Sample-Project W/System.err:     at retrofit.Platform$Android$2$1.run(Platform.java:142)
03-02 14:35:50.064 17161-17161/com.discover.Sample-Project W/System.err:     at java.lang.Thread.run(Thread.java:841)
03-02 14:35:50.064 17161-17161/com.discover.Sample-Project W/System.err: Caused by: java.lang.Exception: Please try in few minutes
03-02 14:35:50.064 17161-17161/com.discover.Sample-Project W/System.err:     at com.discover.Sample-Project.api.Sample-ProjectErrorHandler.handleError(Sample-ProjectErrorHandler.java:77)
03-02 14:35:50.064 17161-17161/com.discover.Sample-Project W/System.err:     at retrofit.CallbackRunnable.run(CallbackRunnable.java:49)
03-02 14:35:50.064 17161-17161/com.discover.Sample-Project W/System.err:    ... 4 more

this question

0 个答案:

没有答案