[YANG] errors

Martin Bjorklund <mbj@tail-f.com> Thu, 24 January 2008 14:37 UTC

Return-path: <yang-bounces@ietf.org>
Received: from [127.0.0.1] (helo=stiedprmman1.va.neustar.com) by megatron.ietf.org with esmtp (Exim 4.43) id 1JI3Cu-0001yv-QZ; Thu, 24 Jan 2008 09:37:32 -0500
Received: from yang by megatron.ietf.org with local (Exim 4.43) id 1JI3Cu-0001yq-At for yang-confirm+ok@megatron.ietf.org; Thu, 24 Jan 2008 09:37:32 -0500
Received: from [10.91.34.44] (helo=ietf-mx.ietf.org) by megatron.ietf.org with esmtp (Exim 4.43) id 1JI3Ct-0001yi-4v for yang@ietf.org; Thu, 24 Jan 2008 09:37:31 -0500
Received: from [213.180.94.162] (helo=mail.tail-f.com) by ietf-mx.ietf.org with esmtp (Exim 4.43) id 1JI3Cs-0005zQ-L2 for yang@ietf.org; Thu, 24 Jan 2008 09:37:31 -0500
Received: from localhost (138.162.241.83.in-addr.dgcsystems.net [83.241.162.138]) by mail.tail-f.com (Postfix) with ESMTP id A0F4C1B80DA for <yang@ietf.org>; Thu, 24 Jan 2008 15:37:28 +0100 (CET)
Date: Thu, 24 Jan 2008 15:38:53 +0100 (CET)
Message-Id: <20080124.153853.210376606.mbj@tail-f.com>
To: yang@ietf.org
From: Martin Bjorklund <mbj@tail-f.com>
X-Mailer: Mew version 5.1.51 on Emacs 22.1 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Scan-Signature: fb6060cb60c0cea16e3f7219e40a0a81
Subject: [YANG] errors
X-BeenThere: yang@ietf.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: YANG modeling Language for NETCONF <yang.ietf.org>
List-Unsubscribe: <https://www1.ietf.org/mailman/listinfo/yang>, <mailto:yang-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www1.ietf.org/pipermail/yang>
List-Post: <mailto:yang@ietf.org>
List-Help: <mailto:yang-request@ietf.org?subject=help>
List-Subscribe: <https://www1.ietf.org/mailman/listinfo/yang>, <mailto:yang-request@ietf.org?subject=subscribe>
Errors-To: yang-bounces@ietf.org

Hi,

We have been talking about adding two new statements related to
error generation to YANG.

The first statement is 'error'.  It is used to define a named error.
The second statement is 'raise-error'.

For example:

    error no-matches {
      error-tag operation-failed;
      description
        "Generated if the filters return an empty node set.";
    }       

    rpc partial-lock {
      input { ... }
      output { ... }
      raise-error no-matches;
    }

  XML:

    <rpc-error>
      <error-type>application</error-type>
      <error-tag>operation-failed</error-tag>
      <error-severity>error</error-severity>
      <error-app-tag>no-matches</error-app-tag>
    </rpc-error>


The idea is that the error statement is used to define DM-specfic
error messages.  An error is identified by its error-app-tag.  All
errors are defined on the top-level in the module.

The raise-error statement is used to reference an error, either local
in the same module, or imported from some other module.  It will
replace the current error-app-tag/error-message statements in YANG
(can be specified for must, range, length, and pattern).  It can also
be used in the rpc statement, as shown above.

    error bad-ethernet-mtu {
      error-tag invalid-value;
      error-message "An ethernet MTU must be 1500";
    }

    must "ifType != ethernet or " +
         "(ifType == ethernet and ifMTU == 1500)" {
      raise-error bad-ethernet-mtu;
    }

The errors defined for an rpc would be in addition to the standard
errors defined in rfc4741.

Grammar:

    error-stmt = error-keyword sep error-app-tag-str optsep "{"
      ; error-app-tag-str is an identifier 
      error-tag-stmt stmtsep
      [error-message-stmt stmtsep]
      [error-severity-stmt stmtsep]   ; default is error
      [description-stmt stmtsep]
      [reference-stmt stmtsep]
    "}"

  raise-error error-app-tag-ref-str stmtsep


Comments?


/martin


_______________________________________________
YANG mailing list
YANG@ietf.org
https://www1.ietf.org/mailman/listinfo/yang