我使用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