[Contents] [Prev] [Next] [Index] [Report an Error]

Accurate Use of Error Status When Accessed Ourside of onError Macro

When the status is requested from a macro other than the onError macro, the error status reported is unavailable and the error string is empty.

For example, the following macro gets the command error and status. The macro is not an onError macro so the status is reported as unavailable.

<# errorStatusTest #>

<# setoutput console #>
<# "error: " $ env.getErrorCommand $ "\n" #>
<# "status: " $ env.getErrorStatus $ "\n\n" #>
<# endsetoutput #>

<#endtmpl#>

When you run the macro, the error command is blank and the error status is Status is not available:

ERX-40-4a-cc#macro b.mac errorStatusTest
Macro 'errorStatusTest' in file 'b.mac' starting execution (Id: 17)
error: 
status: "Macro is not onError. Status is not available"

Macro 'errorStatusTest' in file 'b.mac' ending execution (Id: 17)

[Contents] [Prev] [Next] [Index] [Report an Error]