Created
December 17, 2015 18:58
-
-
Save niftynei/5b247fffec6f5b765716 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public <ReturnType> EoNetworkRequest<ReturnType> makeRequest(EoNetworkRequest<ReturnType> request) { | |
try { | |
retrofit.Response<ReturnType> response = request.makeRequest(); | |
if (response.isSuccess()) { | |
return request; | |
} else { | |
// todo: parse the error body into some sort of usable structure. or something?? | |
} | |
} catch (IOException e) { // network error | |
request.setNetworkError(e); | |
} catch (Exception ex) { | |
// unexpected error! probably best practice to throw. | |
// throw ex; | |
EoLog.e(TAG, ex); | |
} | |
return request; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment