Content deleted Content added
Petr Matas (talk | contribs) →Script errors: Reply to Johnuniq |
m Reverted edits by Athishraj081 (talk) to last version by Redrose64 |
||
(5 intermediate revisions by 5 users not shown) | |||
Line 21:
::The line <code>local result = { func(...) }</code> stores the (possibly multiple) values returned from the function in a table. Its counterpart is <code>return unpack(result)</code>, which returns the contents of the table as multiple values.
::To avoid throwing an error from the module, I have encapsulated the entire main in pcall. This way we can keep using error(), I hope. Thus, pcall at other places becomes unnecessary. <span style="font-family:Segoe Script">[[User:Petr Matas|Petr Matas]]</span> 09:47, 18 August 2018 (UTC)
:::That looks good. To avoid a maze of dependencies I wouldn't call [[Module:Error]] but I agree it has the advantage of being only one place to accommodate any change to how the error class works in the future. In callAssert there is no reason to use mw.ustring.format rather than the more efficient string.format. However, that's unimportant. I was going to add that the error category is now empty but I see that a problem in another module has filled it up again! Keeps me employed. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 10:11, 18 August 2018 (UTC)
|