Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Announcement: Try the Ask AI chatbot for answers to your technical questions about Juniper products and solutions.

close
header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
Automation Scripting User Guide
Table of Contents Expand all
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

terminate

date_range 13-Jan-21

Syntax

content_copy zoom_out_map
terminate expression;
content_copy zoom_out_map
terminate {
   /* body */
}

Description

Generate an error message that is immediately displayed to the user, and exit the script.

Junos OS op scripts, event scripts, and commit scripts prepend "error:" to the displayed message when generating text output. When generating XML output, the scripts place the output inside a <message> element, which is enclosed in an <xmn:error> element.

If the terminate statement is used in a commit script, the script will generate two errors and terminate the script and the commit process. If the terminate statement is used in an event script, the script writes the message to the output file, if one is configured, and terminates the script.

Attributes

expression

XPath expression or string emitted as output.

SLAX Example

content_copy zoom_out_map
if (not(valid)) {
    terminate "The " _ name() _ " node is not valid. Exiting script.";
}

Release Information

Statement introduced in version 1.1 of the SLAX language, which is supported in Junos OS Release 12.2 and later releases.

footer-navigation