Automation Engine Script Guide > Ordered by Function > Error Handling and Messages > SYS_LAST_ERR_SYSTXT

SYS_LAST_ERR_SYSTXT

Script Function: Retrieves the last-occurred error message from the operating system

Syntax

SYS_LAST_ERR_SYSTXT()

Return codes

Error text from the operating system of a latest occurred error
" " - no error occurred

Comments

This scriptA particular Automation Engine object type. functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,… determines the error message supplied by the operating system in case of occurring errors. The return codeThe value that represents the result of tasks and script functions. of this script function is the message text or an empty string if there was no error.

Example

The example tries to check the memory of a drive. An error occurs if it is not available. The message text of the operating system ("System cannot find specified path.") will then be sent to a userIn the Automation Engine, a user is an instance of a User object, and generally the user is a specific person who works with Automic products. The User object is assigned a user ID and then a set of access rights to various parts of the Automation Engine system and product suite. These access rights come in the form of Automation Engine authorizations and privileges, Decision user roles and EventBase rights and ARA web application object rights. You can manage all these centrally in the ECC user management functions. See also, Unified user management..

:SET &CHECK# = GET_FILESYSTEM("WIN21G", "Z:\", FILESYSTEM_SPACE_TOTAL)
:
SET &MESSAGE# = SYS_LAST_ERR_SYSTXT()
:
IF &MESSAGE# NE ""
:   
SEND_MSG BU,BU,"System error: &MESSAGE#"
:
ENDIF

 

See also:

Script element Description
SYS_LAST_ERR_NR Returns the number of the error that has last occurred.

Script Elements - Error Handling and Messages

About Scripts
Script Elements - Alphabetical Listing

Script Elements - Ordered by Function

 


Automic Documentation - Tutorials - Automic Blog - Resources - Training & Services - Automic YouTube Channel - Download Center - Support

Copyright © 2016 Automic Software GmbH