Supported Platforms
message
Syntax
message expression;
message { /* body */ }
Release Information
Statement introduced in version 1.1 of the SLAX language, which is supported in Junos OS Release 12.2 and later releases.
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
if (not(valid)) { message "The " _ name() _ " node is not valid"; }