<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://stockhub.co/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://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ACallAssert%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:CallAssert/doc&amp;action=history"/>
	<updated>2026-04-16T18:56:39Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://stockhub.co/index.php?title=Module:CallAssert/doc&amp;diff=135458&amp;oldid=prev</id>
		<title>imported&gt;Alexiscoutinho: Removed unnecessary supercategory</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:CallAssert/doc&amp;diff=135458&amp;oldid=prev"/>
		<updated>2021-07-05T21:25:12Z</updated>

		<summary type="html">&lt;p&gt;Removed unnecessary supercategory&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 &amp;#039;&amp;#039;&amp;#039;callAssert&amp;#039;&amp;#039;&amp;#039;, 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(&amp;#039;Module:CallAssert&amp;#039;)&lt;br /&gt;
 local result1, result2, etc = &amp;#039;&amp;#039;&amp;#039;callAssert(&amp;#039;&amp;#039;func&amp;#039;&amp;#039;, {{&amp;#039;}}&amp;#039;&amp;#039;funcName&amp;#039;&amp;#039;{{&amp;#039;}}, ...)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;callAssert&amp;lt;/code&amp;gt; calls &amp;lt;code&amp;gt;&amp;#039;&amp;#039;func&amp;#039;&amp;#039;(...)&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;{{&amp;#039;}}&amp;#039;&amp;#039;funcName&amp;#039;&amp;#039;(&amp;#039;&amp;#039;argument_values&amp;#039;&amp;#039;) failed&amp;#039;&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>imported&gt;Alexiscoutinho</name></author>
	</entry>
</feed>