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

Handling an Error or Warning

If the JUNOScript server encounters an error condition, it emits an <xnm:error> tag element, which encloses child tag elements that describe the nature of the error. Client applications must be prepared to receive and handle an <xnm:error> tag element at any time. The information in any response tag elements already received and related to the current request might be incomplete. The client application can include logic for deciding whether to discard or retain the information.

The syntax of the <xnm:error> tag element is as follows. The opening tag appears on multiple lines only for legibility:

<xnm:error xmlns="http://xml.juniper.net/xnm/1.1/xnm" \
            xmlns:xnm="http://xml.juniper.net/xnm/1.1/xnm">
    <!- - tag elements describing the error - ->
</xnm:error>

The attributes are as follows:

The set of child tag elements enclosed in the <xnm:error> tag element depends on the operation that server was performing when the error occurred:

If the JUNOScript server encounters a less serious problem, it can emit an <xnm:warning> tag element instead. The usual response for the client application in this case is to log the warning or pass it to the user, but to continue parsing the server’s response.

For a description of the child tag elements that can appear within an <xnm:error> or <xnm:warning> tag element to specify the nature of the problem, see <xnm:error> and <xnm:warning>.


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