<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mywikibiz.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ACallAssert%2Fdoc</id>
	<title>Module:CallAssert/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mywikibiz.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ACallAssert%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://mywikibiz.com/index.php?title=Module:CallAssert/doc&amp;action=history"/>
	<updated>2026-06-14T09:46:41Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.3</generator>
	<entry>
		<id>https://mywikibiz.com/index.php?title=Module:CallAssert/doc&amp;diff=471169&amp;oldid=prev</id>
		<title>Zoran: Pywikibot 6.4.0</title>
		<link rel="alternate" type="text/html" href="https://mywikibiz.com/index.php?title=Module:CallAssert/doc&amp;diff=471169&amp;oldid=prev"/>
		<updated>2021-07-15T20:53:33Z</updated>

		<summary type="html">&lt;p&gt;Pywikibot 6.4.0&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Module rating|r}}&lt;br /&gt;
{{used in system}}&lt;br /&gt;
This [[Help:Lua metamodules|metamodule]] provides function '''callAssert''', which simplifies error checking by throwing an error if a given function returns nil or false. This is similar to the built-in function [[mw:LUAREF#assert|assert]], but unlike it, callAssert itself calls the function, whose return value is to be checked. This allows it to include the function name and argument values in the error message.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
 local callAssert = require('Module:CallAssert')&lt;br /&gt;
 local result1, result2, etc = '''callAssert(''func'', {{'}}''funcName''{{'}}, ...)'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;callAssert&amp;lt;/code&amp;gt; calls &amp;lt;code&amp;gt;''func''(...)&amp;lt;/code&amp;gt; and checks if the first returned value evaluates to true. If it does, then it returns all the returned values. If not, it throws an error with a message in the form &amp;lt;code&amp;gt;{{'}}''funcName''(''argument_values'') failed'&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{#ifeq:{{SUBPAGENAME}}|sandbox | |&lt;br /&gt;
[[Category:Error-handling modules]]&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zoran</name></author>
	</entry>
</feed>