Ex() private method

private Ex ( Exception ex, string message ) : void
ex Exception
message string
return void
示例#1
0
 public static void CallStaticSafe(this AndroidJavaObject ajo, string methodName,
                                   params object[] args)
 {
     try
     {
         ajo.CallStatic(methodName, args);
     }
     catch (Exception e)
     {
         GetSocialDebugLogger.Ex(e, string.Format("Failed to call {0} on {1}", methodName, ajo.GetClassName()));
     }
 }
示例#2
0
 public static void CallSafe(this AndroidJavaObject ajo, string methodName,
                             params object[] args)
 {
     try
     {
         ajo.Call(methodName, args);
     }
     catch (Exception exception)
     {
         GetSocialDebugLogger.Ex(exception, string.Format("Failed to call {0} because of: {1}", methodName, exception.Message));
     }
 }
示例#3
0
        private static void HandleAndroidJavaObjectCallException <T>(AndroidJavaObject ajo, string methodName,
                                                                     Exception exception)
        {
            // If we call method that return null from Java an exception will be thrown. So we have to ignore most part of them.
            // Related Unity issue: https://issuetracker.unity3d.com/issues/androidjavaobject-dot-call-throws-exception-instead-of-returning-null-pointer
            // Fixed in Unity 5.6.0
            var isExceptionCausedByNullObjectReturnedFromJava =
                typeof(T) == typeof(AndroidJavaObject) &&
                exception.Message.Contains("AndroidJavaObject with null ptr");

            if (!isExceptionCausedByNullObjectReturnedFromJava)
            {
                GetSocialDebugLogger.Ex(exception,
                                        string.Format("Failed to call {0} on {1}", methodName, ajo));
            }
        }