package com.sjkj.base_lib.net.domain.interactor;

import android.content.Context;

import com.sjkj.base_lib.app.BaseApp;
import com.sjkj.base_lib.utils.CommonUtils;

import rx.Subscriber;

public abstract class ProcessErrorSubscriber<T> extends Subscriber<T> {

    private final Context context;


    public ProcessErrorSubscriber() {
        context = BaseApp.getInstance();
    }

    public ProcessErrorSubscriber(Context context) {
        this.context = context;
    }


    @Override
    public void onCompleted() {

    }

    @Override
    public void onError(Throwable e) {
//        if (context != null) {
//            Toast.makeText(context, e.getMessage(), Toast.LENGTH_SHORT).show();
//        }
    }

    @Override
    public void onNext(T t) {

    }

    public void onNext(T t, String msg) {
        msg = CommonUtils.stringNotEmpty(msg);
    }


}
