confirms that expr does not represent an error, otherwise throwing a Failure to the nearest lexically surrounding Enclose.


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.


open allclose all

Basic Examples  (2)

Confirm that a expression doesn't represent an error, stopping evaluation if it does:

Create a function that propagates errors in its arguments:

Scope  (3)

Confirm stops evaluation and returns to the matching Enclose when it throws an error:

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:

This behavior is overruled when info is provided:

Applications  (1)

Print a message when a confirmation fails:

Possible Issues  (1)

Confirm must be given a tag, or be within a lexical Enclose:

Wolfram Research (2020), Confirm, Wolfram Language function,


Wolfram Research (2020), Confirm, Wolfram Language function,


Wolfram Language. 2020. "Confirm." Wolfram Language & System Documentation Center. Wolfram Research.


Wolfram Language. (2020). Confirm. Wolfram Language & System Documentation Center. Retrieved from


@misc{reference.wolfram_2024_confirm, author="Wolfram Research", title="{Confirm}", year="2020", howpublished="\url{}", note=[Accessed: 20-July-2024 ]}


@online{reference.wolfram_2024_confirm, organization={Wolfram Research}, title={Confirm}, year={2020}, url={}, note=[Accessed: 20-July-2024 ]}