Back to project page droidcon.
The source code is released under:
Apache License
If you think the Android project droidcon listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.timehop.droidcon2014retrofitsample.data.foursquare.api; /*from w w w . ja va 2 s . c o m*/ import retrofit.ErrorHandler; import retrofit.RetrofitError; public class FoursquareErrorHandler implements ErrorHandler { @Override public Throwable handleError(RetrofitError cause) { if (cause.getResponse() != null && cause.getSuccessType() == FoursquareResponse.class) { FoursquareResponse response = (FoursquareResponse) cause.getBody(); if (response.getMeta().getErrorDetail() != null) { return new FoursquareException(response.getMeta().getErrorDetail(), cause); } } return cause; } }