We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3e9bd9c commit fdae614Copy full SHA for fdae614
1 file changed
spotify-api/src/main/java/kaaes/spotify/webapi/android/SpotifyError.java
@@ -37,7 +37,13 @@ public class SpotifyError extends Exception {
37
private final ErrorDetails mErrorDetails;
38
39
public static SpotifyError fromRetrofitError(RetrofitError error) {
40
- ErrorResponse errorResponse = (ErrorResponse) error.getBodyAs(ErrorResponse.class);
+ ErrorResponse errorResponse = null;
41
+
42
+ try {
43
+ errorResponse = (ErrorResponse) error.getBodyAs(ErrorResponse.class);
44
+ } catch (Exception e) {
45
+ e.printStackTrace();
46
+ }
47
48
if (errorResponse != null && errorResponse.error != null) {
49
String message = errorResponse.error.status + " " + errorResponse.error.message;
0 commit comments