package com.kogimobile.android.baselibrary.rest.model.error;

import android.content.Context;

import com.kogimobile.android.baselibrary.R;

/**
 * Created by Julian Cardona on 11/12/14.
 */
public class ErrorFactory {

    public static final int GENERAL_DEFAULT_ERROR = -1;

    public static String getErrorMessage(Context ctx, int code){
        try {
            int id = ctx.getResources().getIdentifier("error_code_" + code, "string", ctx.getPackageName());
            return ctx.getString(id);
        }catch (Exception e){
            return ctx.getString(R.string.network_error_code_general);
        }
    }

}

@@ -349,16 +349,142 @@
   try %7B%0A
+            String errorCodeMapping = String.valueOf(code);%0A            errorCodeMapping = errorCodeMapping.replace(%22-%22,%22_%22);%0A
         
@@ -545,20 +545,32 @@
 ode_%22 + 
-code
+errorCodeMapping
 , %22strin

add mapping for negative error codes