Ejemplo n.º 1
0
		public static void HandleTException (Context ctx, TException ex)
		{
			var errMsg = AppCommon.Inst.ErrorTranslator.GetErrMessage (ex);
			if(errMsg != null)
				Utils.Alert (ctx, errMsg.Item1, errMsg.Item2, false);
			else
				AppCommon.Inst.Log.Error (ex.ToString ());
		}
		public override Tuple<string, string> GetErrMessage (TException ex)
		{
			var se = ex as ServerError;
			if (se == null)
				return Tuple.Create ("No Internet Connectivity", "Please ensure Wifi/data network is enabled and reachable"); 
			switch(se.Err) {
			case ErrorCode.InvalidArg: 
				return Tuple.Create("Invalid Input", "Please check and enter valid entries");
			case ErrorCode.UserNotFound:
				return Tuple.Create("Please Register", "User not registered. Please sign up.");
			default:
				return null;
			}
		}
Ejemplo n.º 3
0
		public abstract Tuple<string, string> GetErrMessage (TException ex);