Exemplo n.º 1
0
        public void OnFailure(Java.Lang.Exception e)
        {
            var source    = e.Cause;
            var errorType = e.GetType();

            Console.WriteLine("Exception caught: ", e.GetType());
        }
Exemplo n.º 2
0
 public void OnFailure(Java.Lang.Exception e)
 {
     Log.Info(TAG, "Onfailure");
     if (e.GetType() == typeof(IapApiException))
     {
         IapApiException apiException = (IapApiException)e;
         if (apiException.Status.StatusCode == OrderStatusCode.OrderHwidNotLogin)
         {
             if (apiException.Status.HasResolution)
             {
                 try
                 {
                     Log.Info(TAG, apiException.Status.StatusMessage);
                     apiException.Status.StartResolutionForResult(MainActivity.CurrentContext, Constants.REQ_CODE_LOGIN);
                 }
                 catch (Java.Lang.Exception exp)
                 {
                     Log.Error(TAG, exp.Message);
                 }
             }
         }
         else if (apiException.Status.StatusCode == OrderStatusCode.OrderAccountAreaNotSupported)
         {
             Toast.MakeText(MainActivity.CurrentContext, "This is unavailable in your country/region.", ToastLength.Long).Show();
         }
     }
 }
Exemplo n.º 3
0
        public virtual void OnError(Java.Lang.Exception error)
        {
            System.Diagnostics.Debug.WriteLine("Error received (" + error.GetType() + "): " + error.Message);
            System.Diagnostics.Debug.WriteLine(error.StackTrace);

            ShowDialog("An error occurred ");
        }
Exemplo n.º 4
0
        public static int handle(Activity activity, Java.Lang.Exception e)
        {
            if ((e.GetType() == typeof(IapApiException)))
            {
                IapApiException iapApiException = (IapApiException)e;
                int             StatusCode      = iapApiException.Status.StatusCode;
                Log.Debug("Error", "returnCode: " + StatusCode);
                switch (StatusCode)
                {
                case OrderStatusCode.OrderStateCancel:
                    Toast.MakeText(activity, "Order has been canceled!", ToastLength.Short).Show();
                    return(SOLVED);

                case OrderStatusCode.OrderStateParamError:
                    Toast.MakeText(activity, "Order state param error!", ToastLength.Short).Show();
                    return(SOLVED);

                case OrderStatusCode.OrderStateNetError:
                    Toast.MakeText(activity, "Order state net error!", ToastLength.Short).Show();
                    return(SOLVED);

                case OrderStatusCode.OrderVrUninstallError:
                    Toast.MakeText(activity, "Order vr uninstall error!", ToastLength.Short).Show();
                    return(SOLVED);

                case OrderStatusCode.OrderProductOwned:
                    Toast.MakeText(activity, "Product already owned error!", ToastLength.Short).Show();
                    return(OrderStatusCode.OrderProductOwned);

                case OrderStatusCode.OrderProductNotOwned:
                    Toast.MakeText(activity, "Product not owned error!", ToastLength.Short).Show();
                    return(SOLVED);

                case OrderStatusCode.OrderProductConsumed:
                    Toast.MakeText(activity, "Product consumed error!", ToastLength.Short).Show();
                    return(SOLVED);

                case OrderStatusCode.OrderAccountAreaNotSupported:
                    Toast.MakeText(activity, "Order account area not supported error!", ToastLength.Short).Show();
                    return(SOLVED);

                case OrderStatusCode.OrderNotAcceptAgreement:
                    Toast.MakeText(activity, "User does not agree the agreement", ToastLength.Short).Show();
                    return(SOLVED);

                default:
                    // handle other error scenarios
                    Toast.MakeText(activity, "Order unknown error!", ToastLength.Short).Show();
                    return(SOLVED);
                }
            }
            else
            {
                Toast.MakeText(activity, "external error", ToastLength.Short).Show();
                Log.Debug("Error", e.Message);
                return(SOLVED);
            }
        }
 public void OnFailure(Java.Lang.Exception e)
 {
     if (e.GetType() == typeof(IapApiException))
     {
         IapApiException apiException = (IapApiException)e;
         int             returnCode   = apiException.Status.StatusCode;
         Log.Error(TAG, "consumeOwnedPurchase fail, IapApiException returnCode: " + returnCode);
     }
     else
     {
         Log.Error(TAG, e.Message);
     }
 }
Exemplo n.º 6
0
 public static void LogError(Java.Lang.Exception ex)
 {
     Log.Error(Constants.LoggingLabel, ex.ToString() + Environment.NewLine + Environment.NewLine + ex.GetType().ToString() + Environment.NewLine + ex.Message != null && ex.Message != string.Empty ? ex.Message : "Exception message was empty." + Environment.NewLine + ex.InnerException != null ? ex.InnerException.Message : "InnerException was empty." + Environment.NewLine + ex.StackTrace != null ? ex.StackTrace : "Stacktrace was empty.");
 }