EasyManuals Logo

Juniper SYSTEM BASICS - CONFIGURATION GUIDE V 11.1.X User Manual

Juniper SYSTEM BASICS - CONFIGURATION GUIDE V 11.1.X
640 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #521 background imageLoading...
Page #521 background image
host1# macro verbose macro1.mac callAnotherMacro
host1#!Macro 'callAnotherMacro' in the file 'macro1.mac' starting execution (Id: 55)
macro macro2.mac macroName2 5 string1
!Macro 'macroName2' in the file 'macro2.mac' starting execution
!Macro 'macroName2' in the file 'macro2.mac' ending execution
host1#!Macro 'callAnotherMacro' in the file 'macro1.mac' ending execution (Id: 55)
The invoked macro cannot invoke a third macro from another file. Only a single level
of invocation is supported.
Detecting and Recording Macro Errors
You can control how a macro responds when an error occurs during execution. By
creating and adding an onError macro to your macro file, you can specify that, on
the occurrence of an error, macro execution within the current macro stops and the
onError macro is invoked. An onError macro can call other macros. If another error
occurs after the onError macro is invoked, macro execution stops again and the
onError macro is invoked again. This process continues either until the onError macro
completes or until reaching the recursion limit of 10.
Detectable Macro Errors
CLI macros detect various errors when a macro is executed. Some of these errors
are detected without the use of an onError macro; they include the following:
â–  Macro file not found
â–  Macro not found
â–  Macro compilation error
â–  Macro does not complete error due to excessive looping or recursion
The following errors are detected only when a CLI macro file contains an onError
macro:
â–  Syntactic error in executed CLI command
â–  Runtime error in executed CLI command
In addition to these detectable errors, you can use the following environment
commands to return textual error information to the macroData log file:
â–  env.getErrorCommand
â–  env.getErrorStatus
CAUTION: Though you can use the env.getErrorCommand and env.getErrorStatus
commands in any macro, the only appropriate place from which to execute these
commands is from an onError macro.
Detecting and Recording Macro Errors â–  491
Chapter 8: Writing CLI Macros

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Juniper SYSTEM BASICS - CONFIGURATION GUIDE V 11.1.X and is the answer not in the manual?

Juniper SYSTEM BASICS - CONFIGURATION GUIDE V 11.1.X Specifications

General IconGeneral
BrandJuniper
ModelSYSTEM BASICS - CONFIGURATION GUIDE V 11.1.X
CategorySoftware
LanguageEnglish

Related product manuals