Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-538

Yang parser exceptions should follow consistent path

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Done
    • None
    • None
    • None
    • None
    • Operating System: All
      Platform: All

    • 4540

    Description

      The build methods in BuildGlobalContext declare SourceException and ReactorException to be thrown and it seems the intention is for completePhaseAction to assemble all SourceException errors into a single checked ReactorException.

      However, there are several (maybe many) yang syntax violations that cause unchecked exceptions to be thrown, eg IllegalStateException and IllegalArgumentException.

      If you specify an invalid type, eg "string1":

      typedef revision-identifier {
      type string1

      { ... }

      }

      you'll see an IllegalStateException thrown. If you specify an invalid yang statement like "grouping1" instead of "grouping", you'll see an IllegalArgumentException.

      The code should be consistent and only propagate errors via the declared checked exceptions.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ifoltin Igor Foltin
            tpantelis Tom Pantelis
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: