Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

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

message

date_range 13-Jan-21

Syntax

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

Description

Generate an error message that is immediately displayed to the user, typically on the standard error file descriptor. This is different from most script output, which is displayed only after the script generates the final result tree.

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 message statement is used in a commit script, the script will generate two errors and terminate the commit process. If the message statement is used in an event script, the script writes the message to the output file, if one is configured.

Attributes

message expression

XPath expression or string emitted as output.

SLAX Example

content_copy zoom_out_map
if (not(valid)) {
    message "The " _ name() _ " node is not valid";
}

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