ContractHelper.TriggerFailure Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Triggers the default failure behavior.
public:
static void TriggerFailure(System::Diagnostics::Contracts::ContractFailureKind kind, System::String ^ displayMessage, System::String ^ userMessage, System::String ^ conditionText, Exception ^ innerException);
public static void TriggerFailure (System.Diagnostics.Contracts.ContractFailureKind kind, string displayMessage, string userMessage, string conditionText, Exception innerException);
static member TriggerFailure : System.Diagnostics.Contracts.ContractFailureKind * string * string * string * Exception -> unit
Public Shared Sub TriggerFailure (kind As ContractFailureKind, displayMessage As String, userMessage As String, conditionText As String, innerException As Exception)
Parameters
- kind
- ContractFailureKind
The type of failure.
- displayMessage
- String
The message to display.
- userMessage
- String
Additional user information.
- conditionText
- String
The description of the condition that caused the failure.
- innerException
- Exception
The inner exception that caused the current exception.
Remarks
The default failure behavior is to raise an Assert, which causes the Assert dialog box to be displayed. You can change that behavior to throw an Exception instead of displaying the dialog box.