1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
public static void checkErrors(String error,String where, String errCode, Context context) {
switch(Integer.parseInt(errCode)) {
case 14:
//sql error
Toast.makeText(context, error+" "+where+errCode+": SQL", Toast.LENGTH_LONG).show();
break;
case 15:
//point virgule dans la chaine
Toast.makeText(context,error+" "+where+errCode+": rajouter un string pour dir qu'il y a un ;", Toast.LENGTH_LONG).show();
break;
case 40:
//connection error
//Toast.makeText(context, getString(R.string.errorFTP), Toast.LENGTH_LONG).show();
break;
case 90:
//table missing
Toast.makeText(context, getString(R.string.error)+" "+where+errCode+": "+getString(R.string.errortablemissing), Toast.LENGTH_LONG).show();
break;
case 91:
//user error
Toast.makeText(getBaseContext(), getString(R.string.error)+" "+where+errCode+":"+getString(R.string.erroridmissing), Toast.LENGTH_LONG).show();
break;
case 63:
//no record present
Toast.makeText(getBaseContext(), getString(R.string.error)+" "+where+errCode+": "+getString(R.string.errornodata), Toast.LENGTH_LONG).show();
break;
default:
//other error
Toast.makeText(context, getString(R.string.error)+" "+where+errCode, Toast.LENGTH_LONG).show();
break;
}
}
} |
Partager