protected virtual void ShowError(ConstellationError e = null, Exception exception = null)
        {
            var error = e.GetError();

            if (error.IsIgnorable())
            {
                if (EditorUtility.DisplayDialog(error.GetErrorTitle() + " (" + error.GetID() + ") ", error.GetErrorMessage(), "Recover", "Ignore"))
                {
                    UnityEditor.EditorApplication.isPlaying = false;
                }
            }
            else
            {
                if (EditorUtility.DisplayDialog(error.GetErrorTitle() + " (" + error.GetID() + ") ", error.GetErrorMessage(), "Recover"))
                {
                    UnityEditor.EditorApplication.isPlaying = false;
                    scriptDataService.ResetConstellationEditorData();
                    ShowEditorWindow();
                }
            }

            if (exception != null && e != null)
            {
                Debug.LogError(error.GetFormatedError() + exception.StackTrace);
            }
            else if (e != null)
            {
                Debug.LogError(error.GetFormatedError());
            }
        }
Exemple #2
0
        protected virtual void ShowError(ConstellationError constellationError, Exception exception = null)
        {
            var error = constellationError.GetError();

            if (error.IsIgnorable())
            {
                if (EditorUtility.DisplayDialog(error.GetErrorTitle() + " (" + error.GetID() + ") ", error.GetErrorMessage(), "Recover", "Ignore"))
                {
                    UnityEditor.EditorApplication.isPlaying = false;
                }
            }
            else
            {
                if (error.IsReportable())
                {
                    if (EditorUtility.DisplayDialog(error.GetErrorTitle() + " (" + error.GetID() + ") ", error.GetErrorMessage(), "Report and recover", "Recover"))
                    {
                        Application.OpenURL("https://github.com/ConstellationLanguage/Constellation/issues");
                    }
                }
                else
                {
                    EditorUtility.DisplayDialog(error.GetErrorTitle() + " (" + error.GetID() + ") ", error.GetErrorMessage(), "Recover");
                }

                UnityEditor.EditorApplication.isPlaying = false;
                scriptDataService.ResetConstellationEditorData();
                ShowEditorWindow();
            }

            if (exception != null && constellationError != null)
            {
                Debug.LogError(error.GetFormatedError() + exception.StackTrace);
                LogFile.WriteString(constellationError.GetError().GetErrorTitle(), exception.StackTrace);
            }
            else if (constellationError != null)
            {
                Debug.LogError(constellationError.StackTrace);
                LogFile.WriteString(constellationError.GetError().GetErrorTitle(), constellationError.StackTrace);
            }
            else if (exception != null)
            {
                Debug.LogError(exception.StackTrace);
                LogFile.WriteString("Uknown", exception.StackTrace);
            }
        }
Exemple #3
0
 protected override void ShowError(ConstellationError constellationError, Exception exception = null)
 {
     base.ShowError(constellationError, exception);
     if (constellationError != null)
     {
         if (constellationError.GetError().IsCloseEditor())
         {
             WindowInstance.Close();
         }
     }
 }