ui.error(msg , [title])

Displays an error message dialog box with a red-cross icon, and waits for the user to click the OK button.

The Lua error() function when used in a desktop application, shows the same error dialog box then exists the program.

Parameters

msg

A string, or any value converted to a string, that indicates the error message to display to the user.

title

An optional string that indicates the title of the message dialog box (defaulting to "Error")

Return value

This function returns the string "ok" once the user has pressed the OK button or after having closed the dialog.

Example

local ui = require "ui" -- show an error message in a dialog box ui.error("An error have been encountered, application will exit NOW", "Fatal error")