Lumail - The console email client


Lua primitives: on_error()

NOTE: Lumail-legacy has been superseded by Lumail 2.x, which has a wholly unified Lua API.

If you define the function on_idle it will be called whenever there is an error encountered in Lua code.

Error conditions typically occur when one of the primitives is called improperly - for example the scroll_maildir_to() function expects a string argument, but you could call it like so:

scroll_maildir_to( false );

In that situation the argument type wouldn't match the expectations of the function, and an error should be raised.

The standard configuration file contains a simple handler which will alert the user to errors when running in debug-mode only:

--
-- Here we display the error to the user, but only in debug-builds.
--
--
function on_error( text )
   if ( DEBUG == true ) then
      msg( text )
   end
end

Availability

This function has been available since version 0.26.