if expr represents an error, evaluates info and includes the result in the thrown Failure.
uses the specified tag for any thrown errors.
- expr is considered an error if it is $Canceled or satisfies MissingQ or FailureQ.
- expr is returned unchanged if it does not represent an error.
- The default value of info is Null.
- Generally, if expr represents an error then it is wrapped in a Failure before it is thrown. However, if expr has head Failure with tag "ConfirmationFailed", and no info has been provided, Confirm will throw expr without wrapping it in another Failure.
Examplesopen allclose all
Basic Examples (2)
Create a function that calls Confirm with a tag so that it can be caught by an enclosing function:
Errors are wrapped in Failure before they are thrown, unless they came from another call to a confirmation function:
Wolfram Research (2020), Confirm, Wolfram Language function, https://reference.wolfram.com/language/ref/Confirm.html.
Wolfram Language. 2020. "Confirm." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Confirm.html.
Wolfram Language. (2020). Confirm. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Confirm.html