Skip to main content
All docs
V25.1
  • EnvironmentPolicy.FailedEventArgs.ToString() Method

    Returns a human-readable representation of the FailedEventArgs object, which can be useful for debugging, logging, or understanding the failure.

    Namespace: DevExpress.Data.Utils

    Assembly: DevExpress.Data.v25.1.dll

    NuGet Package: DevExpress.Data

    Declaration

    public override string ToString()

    Returns

    Type Description
    String

    The string representation of the FailedEventArgs object.

    Remarks

    using System;
    using System.Windows.Forms;
    
    namespace EnvironmentPolicyDemo {
        internal static class Program {
            /// <summary>
            /// The main entry point for the application.
            /// </summary>
            [STAThread]
            static void Main() {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                DevExpress.Data.Utils.EnvironmentPolicy.ThrowOnErrors();
                DevExpress.Data.Utils.EnvironmentPolicy.Failed += EnvironmentPolicy_Failed;
                Application.Run(new Form1());
            }
    
            static void EnvironmentPolicy_Failed(object sender, DevExpress.Data.Utils.EnvironmentPolicy.FailedEventArgs e) {
                Console.WriteLine(e.ToString());
                e.Throw = false;
            }
        }
    }
    
    See Also