# MX\_SETERR
> [HTML Version](mx_seterr.htm)
_Reviewed and revised April 2024_
**xcall MIAMEX, MX\_SETERR, errnum \{,chan\}**
MX\_SETERR (MIAMEX 182) triggers an ASB error. It may be useful for testing/debugging error handling routines, as well as for using the error trapping mechanism as a way of passing coded signals (i.e. virtual error codes) from within an arbitrarily nested function/procedure up to the main error trap.
**Parameters**
_errnum _ ([Num](num.htm.md)) \[in\]
the ASB error to trigger; sets ERR(0)
_chan _ ([Num](num.htm.md)) \[in\]
channel number; sets ERR(2)
**Comments**
MX\_BASERR is an alias for MX\_SETERR, meaning that calls to MX\_BASERR invoke MX\_SETERR.
**See Also**
• [ERR()](err_system_def.htm.md)
• [Error Trapping](errortrappingasb.htm.md)