Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
freem
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Template talk:Error
(section)
Add languages
Page contents not supported in other languages.
Add topic
Template
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
Add topic
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Some tests== I have edited [[Module:Error/testcases]] [http://en.wikipedia.org/w/index.php?title=Module%3AError%2Ftestcases&action=history] and [[Template:Error/sandbox]] [http://en.wikipedia.org/w/index.php?title=Template%3AError%2Fsandbox&action=history]. If these edits are not helpful, feel free to revert. My self comments: * Adding <code><nowiki>|tag={{{tag}}}</nowiki></code> to the /sandbox looks obvious, since we want to pass that parameter. * /sandbox: Merging params into <code><nowiki>{{{message|{{{1}}}}}}</nowiki></code> 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 {{tl|Error/sandbox}} passes all its template-space {{tl|Error/testcases}} (which is just a limited set). * In [[Module:Error/testcases]], I have added more tests (and grouped them). Also, all current tests are repeated for {{tl|Error/sandbox}} because there seems to be an effect between UnitTest and /sandbox mode. UnitTest failed: * <s>input "0" and "false" (probably the t/f logic is tricked)</s> No, my typo in the testcases ;-) -[[User:DePiep|DePiep]] ([[User talk:DePiep|talk]]) 13:37, 4 April 2013 (UTC) * Input like {{tl|Error}} (that is, no param1 at all) produces testcases: <code>{{{1}}} (vs.) Script error</code>. I guess this is because of the added check: <code>or error('no message specified', 2)</code> in the module. The old template does not have this check. If this is not for debugging, that one could go? It should return <code>{{{1}}}</code> I'd say. (See also the nowiki return texts: class "scribunto-error" was added). ::Adding: This could imply that there is only <code>message = arg[1]</code> 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. -[[User:DePiep|DePiep]] ([[User talk:DePiep|talk]]) 13:37, 4 April 2013 (UTC) More fails I did not see. Hope I did help. -[[User:DePiep|DePiep]] ([[User talk:DePiep|talk]]) 13:27, 4 April 2013 (UTC) :Some addings. -[[User:DePiep|DePiep]] ([[User talk:DePiep|talk]]) 13:37, 4 April 2013 (UTC) ::Thanks for your help here. The script errors in the module unit tests are fine, as the template will not trigger them (it will either show <code><nowiki>{{{1}}}</nowiki></code> 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 <code><nowiki>{{{1}}}</nowiki></code> to the module code. :) It seemed like everything else was working, so I've updated the template. β '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|βͺ talk βͺ]]</sup> 13:54, 4 April 2013 (UTC) :::The error text stays hidden (instead, another error text is shown. ~btw, are errors listed (categorised) somewhere? -[[User:DePiep|DePiep]] ([[User talk:DePiep|talk]]) 14:57, 4 April 2013 (UTC) ::Note: again, the module still checks for these two arguments: <code>message = args.message or args[1] ...</code> 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. -[[User:DePiep|DePiep]] ([[User talk:DePiep|talk]]) 14:02, 4 April 2013 (UTC) :::Hmm, good point. Now that we've changed the invocation from [[Template:Error]] the message parameter isn't needed any more. I don't think having it there causes any harm though. Errors aren't tracked anywhere, no. Traditionally templates that want to track errors will include a tracking category straight after the {{tl|error}} invocation, and the {{tl|error}} template itself doesn't have anything to do with it. β '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|βͺ talk βͺ]]</sup> 15:18, 4 April 2013 (UTC) ::::I must say, when called from another module (not from a template) both options could be available as a ''feature'' (so that module has both options "module=" or "arg[1]=" open to use). Documentation should be clear on this. I don't know if such a feature is good programming basics. But "no harm" is not a good reason to keep idle code. ::::About the internal error: then what is that code doing there? The text is invisible (hidden behind "Script error" error), it is a ''change'' from old template behaviour (because that one did not produce an internal error), and it changes possible current usage depending on the "{{{1}}}" showing. I do agree coding that return text is undesired; at least is could be a blank. ::::As a minor point: why not move the "message = nil" setting to the <code>_error</code> function, together with its next arg logic? -[[User:DePiep|DePiep]] ([[User talk:DePiep|talk]]) 20:37, 4 April 2013 (UTC) :::::Since I cannot prove my point in the sandboxes, I rest my case. -[[User:DePiep|DePiep]] ([[User talk:DePiep|talk]]) 21:07, 4 April 2013 (UTC)
Summary:
Please note that all contributions to freem are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 (see
Freem:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)