ConfirmQuiet[expr]
confirms that no messages are generated during the evaluation of expr, otherwise quieting them and throwing an error to the nearest surrounding Enclose.
ConfirmQuiet[expr,s::t]
tests only for the specified message.
ConfirmQuiet[expr,{s1::t1,s2::t2,…}]
tests only for the specified list of messages.
ConfirmQuiet[expr,"group"]
tests only for messages in the named message group.
ConfirmQuiet[expr,mspec,info]
evaluates info and includes its value in the thrown error if expr is not confirmed.
ConfirmQuiet[expr,mspec,info,tag]
uses the specified tag for any thrown errors.
ConfirmQuiet
ConfirmQuiet[expr]
confirms that no messages are generated during the evaluation of expr, otherwise quieting them and throwing an error to the nearest surrounding Enclose.
ConfirmQuiet[expr,s::t]
tests only for the specified message.
ConfirmQuiet[expr,{s1::t1,s2::t2,…}]
tests only for the specified list of messages.
ConfirmQuiet[expr,"group"]
tests only for messages in the named message group.
ConfirmQuiet[expr,mspec,info]
evaluates info and includes its value in the thrown error if expr is not confirmed.
ConfirmQuiet[expr,mspec,info,tag]
uses the specified tag for any thrown errors.
Details
- ConfirmQuiet[expr,…] returns expr if the evaluation of expr does not generate any specified messages.
- ConfirmQuiet is dynamically scoped when given a tag. Otherwise, it is lexically scoped. »
- The default value of info is Null.
- ConfirmQuiet does not test for messages that have been switched off using Off, or by uses of Quiet that occur inside it.
- The operation of ConfirmQuiet is not affected by being enclosed inside Quiet.
- In ConfirmQuiet[expr,"name"], possible named message groups are given by $MessageGroups.
- ConfirmQuiet stops evaluation when the first matching message is generated. »
- ConfirmQuiet[expr] is equivalent to ConfirmQuiet[expr,All].
- Failure objects generated by ConfirmQuiet include the following fields:
-
"Information" info from ConfirmQuiet[expr,mspec,info,…] "HeldExpression" Hold[expr] from ConfirmQuiet[expr,…] "HeldMessage" Hold[s::t] for the detected message s::t - Values of these fields can be extracted using failure["prop"] or directly through Enclose[expr,"prop"].
Examples
open all close allBasic Examples (1)
ConfirmQuiet[expr] gives expr if evaluating expr does not generate any messages:
Enclose[f[1, ConfirmQuiet[1 / 2], 1 / 3]]Evaluation is stopped as soon as a message is generated, and an error is thrown to the surrounding Enclose:
Enclose[f[1, ConfirmQuiet[1 / 0], 1 / 3]]Scope (3)
ConfirmQuiet stops evaluation and returns to the matching Enclose when a matching message is generated:
Enclose[Echo[1];ConfirmQuiet[Echo[2];0 ^ 0;Echo[3]];Echo[4]]info is only evaluated when expr cannot be confirmed:
Enclose[ConfirmQuiet[Reverse[{1, 2, 3}], All, Echo["info was evaluated"]]]Enclose[ConfirmQuiet[Reverse[12], All, Echo["info was evaluated"]]]Create a function that calls ConfirmQuiet with a tag so that it can be caught dynamically:
f[x_] := g[ConfirmQuiet[1 / x, All, Null, "fooTag"]]h[y_] := Enclose[f[y], Identity, "fooTag"]h[12]h[0]If no tag is given, ConfirmQuiet is lexically scoped:
f2[x_] := g[ConfirmQuiet[1 / x]]h2[y_] := Enclose[f2[y]]h2[12]Properties & Relations (2)
Unlike Check, ConfirmQuiet stops evaluation once a message is generated:
Enclose[ConfirmQuiet[Echo[1];1 / 0;Echo[2]]]Check[Echo[1];1 / 0;Echo[2], "foo"]ConfirmQuiet does not detect messages suppressed by an inner Quiet:
Enclose[ConfirmQuiet[Quiet[1 / 0]]]However, ConfirmQuiet does detect messages suppressed by an outer Quiet:
Quiet[Enclose[ConfirmQuiet[1 / 0]]]Possible Issues (3)
ConfirmQuiet must be given a tag or be within a lexical Enclose:
ConfirmQuiet["Hello"]Untagged ConfirmQuiet works by replacing instances of the symbol ConfirmQuiet with a tagged variant:
Enclose[Hold[ConfirmQuiet]]Tagged ConfirmQuiet requires an Enclose with a matching tag:
Enclose[ConfirmQuiet[1 / 0, All, Null, "foo"], Identity, "bar"]
Related Guides
History
Text
Wolfram Research (2020), ConfirmQuiet, Wolfram Language function, https://reference.wolfram.com/language/ref/ConfirmQuiet.html.
CMS
Wolfram Language. 2020. "ConfirmQuiet." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ConfirmQuiet.html.
APA
Wolfram Language. (2020). ConfirmQuiet. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ConfirmQuiet.html
BibTeX
@misc{reference.wolfram_2026_confirmquiet, author="Wolfram Research", title="{ConfirmQuiet}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/ConfirmQuiet.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_confirmquiet, organization={Wolfram Research}, title={ConfirmQuiet}, year={2020}, url={https://reference.wolfram.com/language/ref/ConfirmQuiet.html}, note=[Accessed: 13-June-2026]}