Jump to: navigation, search

TryCatch/doc


Revision as of 20:07, 13 February 2012 by Amalthea (Talk) (create brief documentation)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


This metatemplate simplifies implementing fallback output if an error occurs due to incorrect input. It returns the first parameter if it does not contain an error (using the #iferror parser function), and the second parameter (or the empty string) otherwise.

Usage

  • {{TryCatch|{{#expr: 1/2}}|Incorrect input}} → 0.5
  • {{TryCatch|{{#expr: 1/0}}|Incorrect input}} → Incorrect input

See also