LassoScript Utility
Basics Browse Detail

[File_CurrentError]

Tag Link [File_CurrentError] Category File
Type Substitution Source Available No
Support Preferred Version 3.0
Change Unchanged Data Source Any
Output Type String or Integer Security Tag, File
Implementation LCAPI Sets Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0, Lasso 5.0, Lasso 3.x

Description

[File_CurrentError] reports the last error reported by a file tag. Accepts an optional keyword -ErrorCode that returns the error code rather than the error message.

Syntax

... File Tags ...
[File_CurrentError]
[File_CurrentError: -ErrorCode]

<?LassoScript
... File Tags ...
File_CurrentError;
File_CurrentError: -ErrorCode;
?>

Parameters

Optional Parameters
-ErrorCode If specified, the current error code is returned rather than the current error message.

Examples

To check whether an error occured after performing a file tag:

Use the [Error_CurrentError] tag. In the following example, the error status is returned after a [File_Copy] operation is performed.

<?LassoScript
      File_Copy: '/myfile.txt', '/LogFiles/myfile.txt';
    Output: (File_CurrentError-ErrorCode) + ': ' + (File_CurrentError);
  ?>

0: No Error