$AssertFunction
specifies a function to apply to assertions that fail.
Details
- $AssertFunction is applied to Assert[test,…] when test is evaluated and found not to be True.
Examples
Basic Examples (1)
You can change the behavior when an assertion fails by assigning to $AssertFunction. This function throws an exception when an assertion fails:
Here the exception thrown by the assertion function is caught:
Wolfram Research (2010), $AssertFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/$AssertFunction.html.
Text
Wolfram Research (2010), $AssertFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/$AssertFunction.html.
CMS
Wolfram Language. 2010. "$AssertFunction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/$AssertFunction.html.
APA
Wolfram Language. (2010). $AssertFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/$AssertFunction.html