Module:Error/Documentation

This module provides  and   functions which templates can invoke when they receive invalid input.

This function issues a warning which only editors can see when previewing the page.

Use this function when a template has a sensible fallback in the face of an error and the error needn't be displayed to the user. For example, a template like Template:Color needn't display an error to readers if given an invalid color name. In this case, the text can still be shown without color as a fallback. The template can quietly inform editors without affecting readers.

This function displays a bolded red error message at the site of the template usage. It also logs an editor warning.

Use this function when a template has no sensible fallback option. A full-on error is appropriate for Template:HW Element when no element type is given, for example. Defaulting to any one element would be unwise as it may display false information to the reader. Likewise, displaying nothing at all may confuse the reader. They may think the element simply hasn't been filled yet, or that maybe the weapon has no element. Better that they know an editor made a mistake. The reader might even be motivated to become an editor and fix it themselves.