// Path: app/src/main/java/com/zulip/android/util/ZLog.java
// public class ZLog {
// 
//     private ZLog() {
//     }
// 
//     public static void logException(Throwable e) {
//         if (!BuildHelper.shouldLogToCrashlytics()) {
//             Log.e("Error", "oops", e);
//         } else {
//             Crashlytics.logException(e);
//         }
//     }
// 
//     public static void log(String message) {
//         if (!BuildHelper.shouldLogToCrashlytics()) {
//             Log.e("Error", message);
//         } else {
//             Crashlytics.log(message);
//         }
//     }
// }


import android.support.annotation.CallSuper;
import com.zulip.android.util.ZLog;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
package com.zulip.android.networking.util;





public abstract class DefaultCallback<T> implements Callback<T> {

    @Override
    @CallSuper
    public void onResponse(Call<T> call, Response<T> response) {
        if (response.isSuccessful()) {
            onSuccess(call, response);
        } else {
            onError(call, response);
        }
    }

    public abstract void onSuccess(Call<T> call, Response<T> response);

    public abstract void onError(Call<T> call, Response<T> response);


    @Override
    public void onFailure(Call<T> call, Throwable t) {
        //log error
// Path: app/src/main/java/com/zulip/android/util/ZLog.java
// public class ZLog {
// 
//     private ZLog() {
//     }
// 
//     public static void logException(Throwable e) {
//         if (!BuildHelper.shouldLogToCrashlytics()) {
//             Log.e("Error", "oops", e);
//         } else {
//             Crashlytics.logException(e);
//         }
//     }
// 
//     public static void log(String message) {
//         if (!BuildHelper.shouldLogToCrashlytics()) {
//             Log.e("Error", message);
//         } else {
//             Crashlytics.log(message);
//         }
//     }
// }


// Path: app/src/main/java/com/zulip/android/networking/util/DefaultCallback.java
import android.support.annotation.CallSuper;
import com.zulip.android.util.ZLog;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

package com.zulip.android.networking.util;





public abstract class DefaultCallback<T> implements Callback<T> {

    @Override
    @CallSuper
    public void onResponse(Call<T> call, Response<T> response) {
        if (response.isSuccessful()) {
            onSuccess(call, response);
        } else {
            onError(call, response);
        }
    }

    public abstract void onSuccess(Call<T> call, Response<T> response);

    public abstract void onError(Call<T> call, Response<T> response);


    @Override
    public void onFailure(Call<T> call, Throwable t) {
        //log error
        ZLog.logException(t);