TraceListener.Fail Method

Definition

Emits error messages to the listener you create when you implement the TraceListener class.

Overloads

Fail(String)

Emits an error message to the listener you create when you implement the TraceListener class.

Fail(String, String)

Emits an error message and a detailed error message to the listener you create when you implement the TraceListener class.

Fail(String)

Emits an error message to the listener you create when you implement the TraceListener class.

public:
 virtual void Fail(System::String ^ message);
public virtual void Fail (string? message);
public virtual void Fail (string message);
abstract member Fail : string -> unit
override this.Fail : string -> unit
Public Overridable Sub Fail (message As String)

Parameters

message
String

A message to emit.

Remarks

The default behavior is to display the specified message in a message box when the application is running in a user-interface mode, and to the TraceListener instances in a TraceListenerCollection collection. By default, the TraceListenerCollection collection has an instance of a DefaultTraceListener. You can customize this behavior by adding a TraceListener to or removing one from the collection.

See also

Applies to

Fail(String, String)

Emits an error message and a detailed error message to the listener you create when you implement the TraceListener class.

public:
 virtual void Fail(System::String ^ message, System::String ^ detailMessage);
public virtual void Fail (string? message, string? detailMessage);
public virtual void Fail (string message, string detailMessage);
abstract member Fail : string * string -> unit
override this.Fail : string * string -> unit
Public Overridable Sub Fail (message As String, detailMessage As String)

Parameters

message
String

A message to emit.

detailMessage
String

A detailed message to emit.

Remarks

The default behavior is to display the message and detailed message in a message box when the application is running in a user-interface mode, and to the TraceListener instances in a TraceListenerCollection collection. By default, the TraceListenerCollection collection has an instance of a DefaultTraceListener. You can customize this behavior by adding a TraceListener to or removing one from the collection.

See also

Applies to