This is the talk page for discussing improvements to the Error template. |
|
{{FormattingError}} also adds pages with errors to a category, so it is easy to find pages that have formatting errors. It also adds an anchor to the page where the error occurs (#FormattingError). I'd like to put similar functionality for {{Error}} and use {{Error}} in {{FormattingError}}, so the layout and such of both can be modified in one place. — SkyLined (talk) 08:41, 13 November 2009 (UTC)
{{{categories}}}
template) certainly makes sense, although I expect that there'll be lots of false positives at first with various uses on template doc pages.As on occasional writer of templates (and long-time software engineer) I like to make them "fail gracefully" when given bad input. (Of course that's not always possible given the limitations of the template language, but at least one can try rather than produce incomprehensible output.) So this template is really great! But I wish I had known about it before. It seems to me, there are a lot of good templates out there that are very hard to find: a problem with Wikipedia generally actually; one tends to be able to find something if one knows what one is looking for, which rather defeats the point.
So, thanks for this, now I know it exists I will use it! (And I know any reply would probably start "er, it's called error, it's pretty obvious", but that's not the problem which is not "what does {{error}}
do?" but "what do I do to produce error output?"). Si Trew (talk) 10:33, 29 June 2010 (UTC)
...
and all that, but I always have this feeling that somewhere, probably more than once, someone must have done this already, leading either to searching (usually with futility) a load of existing templates that appear to do something similar but are not coded to be reused. And the search does just seem inadequate at finding these things.{{Ety}}
which wants to output a list of stuff, like "Tom, Dick and Harry". Surely somewhere there is a kinda {{englist}}
or something that will separate its parameters with commas or " and "? Not that I can find. So I end up writing {{Ety/List}}
in the full knowledge I am reinventing the wheel. I had a similar feeling with {{Cardinal to word}}
and its brethren.You might be pleased to hear I've converted the error output in {{Time of day in words}}
and {{Number to word}}
(and their various subtemplates) to use this. It's a start. Si Trew (talk) 13:23, 1 July 2010 (UTC)
Could the /doc describe how to get a not-strong output? -DePiep (talk) 20:13, 1 September 2010 (UTC)
tag=p, div, span
gives a not-strong output (in my browser). But these are a different thing. They do not define "strong/not-strong". And anyway, showing is not describing, which was my question. -DePiep (talk) 20:33, 1 September 2010 (UTC)
span
and you get, for all intents and purposes, a "non-strong" text. Amalthea 20:49, 1 September 2010 (UTC)
{{FormattingError}} is a similar template that I created to allow other templates to report errors. This template also adds the page to Category:Pages with incorrect formatting templates use, so editors that want to make sure there are no errors on any pages can easily find those pages that have errors. Secondly, it adds id="FormattingError" to the tag it creates for the error message, which means you can scroll down to the first error on a page easily by adding "#FormattingError" to the url of the page. It may be useful to compare both templates and copy useful features from one to the other. It might even be possible to have one use the other to display errors, or even merge them into one template. Unfortunately, I haven't as much time as I used to, so unless somebody else can have a look, this message serves as a "note to self" in case I ever find myself less busy with other things. — SkyLined (talk) 14:51, 2 September 2010 (UTC)
Are there guidelines, styles or good examples for the message-text? Friendly, clear & to the point altogether, shouldn't we provide a link to a help- or /doc page. Error (constructed demo): parameter missing in {{in(tut)}}. -DePiep (talk) 08:26, 7 September 2010 (UTC)
I have edited Module:Error/testcases [1] and Template:Error/sandbox [2]. If these edits are not helpful, feel free to revert. My self comments:
|tag={{{tag}}}
to the /sandbox looks obvious, since we want to pass that parameter.{{{message|{{{1}}}}}}
in the /sandbox is done to copy the behaviour of the existing template. Since handling spaces and priorities in parameter handling will remain, we would like to copy that behaviour, whatever the implications for Module. Now it looks like the template {{Error/sandbox}} passes all its template-space {{Error/testcases}} (which is just a limited set).{{{1}}} (vs.) Script error
. I guess this is because of the added check: or error('no message specified', 2)
in the module. The old template does not have this check. If this is not for debugging, that one could go? It should return {{{1}}}
I'd say. (See also the nowiki return texts: class "scribunto-error" was added).message = arg[1]
to consider (plus a nil-check on that), since the message will only enter through param1. Template param Message is not the same asmodule param message. -DePiep (talk) 13:37, 4 April 2013 (UTC)More fails I did not see. Hope I did help. -DePiep (talk) 13:27, 4 April 2013 (UTC)
{{{1}}}
or whitespace, depending on whether 1 is specified). They might be helpful for other modules that use this module, though, so I'm going to avoid actually programming in {{{1}}}
to the module code. :) It seemed like everything else was working, so I've updated the template. — Mr. Stradivarius ♪ talk ♪ 13:54, 4 April 2013 (UTC)
message = args.message or args[1] ...
while only one (unnamed param 1) exists. At the moment, there is no named parameter "message", so the module should not check for that one. -DePiep (talk) 14:02, 4 April 2013 (UTC)
_error
function, together with its next arg logic? -DePiep (talk) 20:37, 4 April 2013 (UTC)
Foo might not be the best example for an unrecognized word in the usage section. 50.64.119.38 (talk) 19:52, 20 September 2017 (UTC)