Source:
<code>public static void uploadGravatar(final File file, final GravatarUploadListener gravatarUploadListener) { Request request = prepareGravatarUpload(AccountHelper.getDefaultAccount().getEmail(), file); createClient(API_BASE_URL).newCall(request).enqueue( new Callback() { @Override public void onResponse(Call call, final Response response) throws IOException { new Handler(Looper.getMainLooper()).post(new Runnable() { @Override public void run() { if (response.isSuccessful()) { gravatarUploadListener.onSuccess(); } else { AnalyticsTracker.track(AnalyticsTracker.Stat.ME_GRAVATAR_UPLOAD_UNSUCCESSFUL); AppLog.w(AppLog.T.API, "Network call unsuccessful trying to upload Gravatar: " + response.message()); gravatarUploadListener.onError(); } } }); } @Override public void onFailure(okhttp3.Call call, final IOException e) { new Handler(Looper.getMainLooper()).post(new Runnable() { @Override public void run() { AnalyticsTracker.track(AnalyticsTracker.Stat.ME_GRAVATAR_UPLOAD_EXCEPTION); <START> CrashlyticsUtils.logException(e, CrashlyticsUtils.ExceptionType.SPECIFIC, <END> AppLog.T.API, "Network call failure trying to upload Gravatar!"); AppLog.w(AppLog.T.API, "Network call failure trying to upload Gravatar!" + e .getMessage()); gravatarUploadListener.onError(); } }); } }); }</code><technical_language>if add a property named reason (or similar), track of exception message class</technical_language>

Target:
public static void uploadGravatar(final File file, final GravatarUploadListener gravatarUploadListener) { Request request = prepareGravatarUpload(AccountHelper.getDefaultAccount().getEmail(), file); createClient(API_BASE_URL).newCall(request).enqueue( new Callback() { @Override public void onResponse(Call call, final Response response) throws IOException { if (!response.isSuccessful()) { Map<String, Object> properties = new HashMap<>(); properties.put("network_response_code", response.code()); String responseBody; try { responseBody = response.body().string(); } catch (IOException e) { responseBody = "null"; } properties.put("network_response_body", responseBody); AnalyticsTracker.track(AnalyticsTracker.Stat.ME_GRAVATAR_UPLOAD_UNSUCCESSFUL, properties); AppLog.w(AppLog.T.API, "Network call unsuccessful trying to upload Gravatar: " + responseBody); } new Handler(Looper.getMainLooper()).post(new Runnable() { @Override public void run() { if (response.isSuccessful()) { gravatarUploadListener.onSuccess(); } else { gravatarUploadListener.onError(); } } }); } @Override public void onFailure(okhttp3.Call call, final IOException e) { Map<String, Object> properties = new HashMap<>(); properties.put("network_exception_class", e != null ? e.getClass().getCanonicalName() : "null"); properties.put("network_exception_message", e != null ? e.getMessage() : "null"); AnalyticsTracker.track(AnalyticsTracker.Stat.ME_GRAVATAR_UPLOAD_EXCEPTION, properties); CrashlyticsUtils.logException(e, CrashlyticsUtils.ExceptionType.SPECIFIC, AppLog.T.API, "Network call failure trying to upload Gravatar!"); AppLog.w(AppLog.T.API, "Network call failure trying to upload Gravatar!" + (e != null ? e.getMessage() : "null")); new Handler(Looper.getMainLooper()).post(new Runnable() { @Override public void run() { gravatarUploadListener.onError(); } }); } }); }