Namespace LrErrors

This namespace allows you to format Lua error strings that can be used in error dialogs. The built-in Lua error() function is also available in the Lightroom Lua environment.

Access the functions directly from the imported namespace.

Summary

LrErrors.isCanceledError( errorString )
Reports whether an error string returned from a protected call (pcall) represents a user cancellation.
Throws an error indicating that a task was canceled by the user.
Throws an error with a given message.

Functions

LrErrors.isCanceledError( errorString )
Reports whether an error string returned from a protected call (pcall) represents a user cancellation.

First supported in version 1.3 of the Lightroom SDK.

Parameters

1. errorString
(string) The error message returned from pcall.

Return value

(Boolean) True if the message represents a user cancellation.

See also

functionContext:addCleanupHandler
LrErrors.throwCanceled()
Throws an error indicating that a task was canceled by the user.

First supported in version 1.3 of the Lightroom SDK.

LrErrors.throwUserError( text )
Throws an error with a given message. Use the function LrDialogs.attachErrorDialogToFunctionContext() to show a standard error dialog that displays this text.

First supported in version 1.3 of the Lightroom SDK.

Parameters

1. text
(string) The user-visible error message.

See also

LrDialogs.attachErrorDialogToFunctionContext