package com.gh4a.loader;

import java.util.HashMap;

import android.content.Context;
import android.support.v4.content.AsyncTaskLoader;
import android.util.Log;

import com.bugsense.trace.BugSenseHandler;
import com.gh4a.Constants;
import com.gh4a.Constants.LoaderResult;

public abstract class BaseLoader extends AsyncTaskLoader<HashMap<Integer, Object>> {

    public BaseLoader(Context context) {
        super(context);
    }

    @Override
    public HashMap<Integer, Object> loadInBackground() {
        HashMap<Integer, Object> result = new HashMap<Integer, Object>();
        try {
            doLoadInBackground(result);
            return result;
        } catch (Exception e) {
            result.put(LoaderResult.ERROR, true);
            result.put(LoaderResult.ERROR_MSG, e.getMessage());
            if ("Received authentication challenge is null".equalsIgnoreCase(e.getMessage())) {
                result.put(LoaderResult.AUTH_ERROR, true);
            }
            Log.e(Constants.LOG_TAG, e.getMessage(), e);
            return result;
        }
    }
    
    public abstract void doLoadInBackground(HashMap<Integer, Object> result) throws Exception;

}

@@ -159,51 +159,8 @@
 g;%0A%0A
-import com.bugsense.trace.BugSenseHandler;%0A
 impo
@@ -845,16 +845,109 @@
 ssage())
+%0A                    %7C%7C %22No authentication challenges found%22.equalsIgnoreCase(e.getMessage())
 ) %7B%0A    

Handle auth error on JB