Failsafe
Failsafe[f][x1,x2,…]
returns f[x1,x2,…] if none of the xi is considered a failure, and the first failing xi otherwise.
Details
- Failsafe is typically used to create safe versions of functions that can be applied to many inputs, quietly ignoring bad data. »
- Failsafe[f][x] considers x a failure if x has any of the following forms:
-
Failure[…] Missing[…] $Failed $Canceled $Aborted - Failsafe[f][x1,x2,…] returns the first x1 that is any of the above forms. »
Examples
open allclose allBasic Examples (2)
Apply a failsafe version of a function:
The failsafe version returns the argument unchanged when it is a failure:
Make a failsafe version of Sqrt that only applies to positive numbers:
Scope (2)
Properties & Relations (4)
Wolfram Research (2025), Failsafe, Wolfram Language function, https://reference.wolfram.com/language/ref/Failsafe.html.
Text
Wolfram Research (2025), Failsafe, Wolfram Language function, https://reference.wolfram.com/language/ref/Failsafe.html.
CMS
Wolfram Language. 2025. "Failsafe." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Failsafe.html.
APA
Wolfram Language. (2025). Failsafe. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Failsafe.html