コード例 #1
0
 public static void HandleException(VCException e)
 {
     if (e.InnerException is AggregateException)
     {
         var aggregateException = e.InnerException as AggregateException;
         foreach (var exception in aggregateException.InnerExceptions)
         {
             if (exception is VCException)
             {
                 HandleException((VCException)exception);
             }
             else
             {
                 HandleException(new VCException(exception.Message, exception.StackTrace, exception));
             }
         }
     }
     else
     {
         OnNextUpdate.Do(() =>
         {
             if (e is VCConnectionTimeoutException)
             {
                 HandleConnectionTimeOut(e as VCConnectionTimeoutException);
             }
             else if (e is VCLocalCopyLockedException)
             {
                 HandleLocalCopyLocked(e as VCLocalCopyLockedException);
             }
             else if (e is VCNewerVersionException)
             {
                 HandleNewerVersion(e as VCNewerVersionException);
             }
             else if (e is VCMixedRevisionException)
             {
                 HandleMixedRevision(e as VCMixedRevisionException);
             }
             else if (e is VCOutOfDate)
             {
                 HandleOutOfDate(e as VCOutOfDate);
             }
             else if (e is VCCriticalException)
             {
                 HandleCritical(e as VCCriticalException);
             }
             else if (e is VCMissingCredentialsException)
             {
                 HandleUserCredentials();
             }
             else if (e is VCMonoDebuggerAttachedException)
             {
                 HandleMonoDebuggerAttached(e as VCMonoDebuggerAttachedException);
             }
             else
             {
                 HandleBase(e);
             }
         });
     }
 }
コード例 #2
0
        private static void HandleBase(VCException e)
        {
            Debug.LogException(e.InnerException != null ? e.InnerException : e);

            if (!string.IsNullOrEmpty(e.ErrorMessage))
            {
                GoogleAnalytics.LogUserEvent("Exception", e.ErrorMessage);
            }

            var dialog = CustomDialogs.CreateExceptionDialog("UVC Exception", e);

            if (VCSettings.BugReport)
            {
                dialog.AddButton("Report", () => ReportError(e));
            }
            dialog.ShowUtility();

            EditorUtility.ClearProgressBar();
        }
コード例 #3
0
        private static void ReportError(VCException e)
        {
            if (VCSettings.BugReport)
            {
                string title       = Environment.UserName + "@" + Environment.MachineName + " : (" + VCUtility.GetCurrentVersion() + "):\n" + e.ErrorMessage;
                string description = "\n" + e.ErrorDetails;

                var conflicts =
                    VCCommands.Instance.GetFilteredAssets(
                        svnStatus =>
                        svnStatus.treeConflictStatus != VCTreeConflictStatus.Normal || svnStatus.fileStatus == VCFileStatus.Conflicted ||
                        svnStatus.fileStatus == VCFileStatus.Obstructed);

                if (conflicts != null && conflicts.Any())
                {
                    description += "\n\nSVN Conflicts:\n" + conflicts.Select(status => status.assetPath.Compose()).Aggregate((a, b) => a + "\n" + b);
                }

                FogbugzUtilities.SubmitAutoBug(title, description);
            }
        }