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

SYS_LAST_ERR_INS

Script Function: Supplies the variableIt stores or retrieves values dynamically at runtime. An individual Automation Engine object type. message part of the last error

Syntax

SYS_LAST_ERR_INS()

Return codes

Variable message part of the last error
" " - No error has occurred

Comments

Some scriptA particular Automation Engine object type. elements facilitate continued script processing in the case of occurring errors when :ON_ERROR is used. The script functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,… then retrieves the variable part of the error message .

Most error messages do not only consist of a pre-determined text. Parts of the message refer to objectAutomation Engine controlled activities and processes are structured in the form of objects. See also: Task names or script lines, for example. These variable parts of error messages are put in inverted commas.

Example of an error message:

U0020645 - Runtime error in object '&01', line '&02'.: There is no object '&04'.

The variable parts are replaced by values when the above error message is output:

U0020645 - Runtime error in object 'MOVE_OBJECT', line '0003'. There is no object  'MM.CLOSING.2005'.

Example

The example shown below intends to check a hard drive's memory. An error occurs if this hard drive is not available or cannot be accessed. The corresponding error number and variable message parts are read and the entire AE error message is retrieved and 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 &ERRINS# = SYS_LAST_ERR_INS()
:
IF &ERRINS# NE ""
:   
SET &ERRNR#   = SYS_LAST_ERR_NR()
:   
SET &MESSAGE# = GET_MSG_TXT (&ERRNR#,&ERRINS#)
:   
SEND_MSG BU,BU,&MESSAGE# 
:
ENDIF

 

See also:

Script element Description

GET_MSG_TXT

Retrieves the message text of the last error

GET_MSG_TYPE

Retrieves the type of a message number

SYS_LAST_ERR_NR

Returns the number of the last error

SYS_LAST_ERR_SYSTXT

Retrieves the last error message of the OS

Script Elements - Error Handling and Messages

Sample Collection:
Retrieving Error Message and Number

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