Failure
Failure["tag",assoc]
represents a failure of a type indicated by tag, with details given by the association assoc.
Details
- Failure[…]["prop"] extracts a property from a Failure object. Failure[…][{key1,key2,…}] extracts a list of values. »
- Failure[…]["Properties"] returns a list of available properties. »
- The association assoc typically includes:
-
"MessageTemplate" a string template for a message "MessageParameters" parameters to use for the message template - The parameters are effectively inserted into the message template using TemplateApply.
- With the entry "MessageTemplate":>symb::name a message name can be stored for use when a message is generated.
- Failure is generated by Interpreter and related functions. Possible tags in this case are "InterpretationFailure", "RestrictionFailure", "ConditionFailure", and "ConnectionFailure".
Examples
open allclose allBasic Examples (2)
A typical way in which Failure is generated:
Scope (10)
Basic Uses (6)
Create a Failure using only a tag:
Use a template with positional parameters:
Indicate a failure using a StringTemplate:
Indicate a failure using MessageName:
Failure can contain metadata:
Properties & Relations (4)
Use ToString to get the formatted message:
This is equivalent to the "Message" property:
Failure is returned by functions like SendMail and EntityPrefetch:
For these functions, the opposite of Failure is Success:
Failure expressions are FailureQ:
Using an Association with Rule will embed the evaluated expression into the Failure expression:
Use RuleDelayed to prevent evaluation:
Neat Examples (1)
Generate a dataset with all the properties of a Failure expression:
Text
Wolfram Research (2014), Failure, Wolfram Language function, https://reference.wolfram.com/language/ref/Failure.html.
CMS
Wolfram Language. 2014. "Failure." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Failure.html.
APA
Wolfram Language. (2014). Failure. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Failure.html