Error tags are well-defined and mandatory-to-include in NETCONF/YANG
error handling model. Make sure we expose this information from
YangError (and by extension from YangInvalidValueException).
JIRA: YANGTOOLS-1301
Change-Id: Ie914fda40b04facf56c5d644c41b3c91a8948dcd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
@NonNull ErrorSeverity getSeverity();
/**
@NonNull ErrorSeverity getSeverity();
/**
- * Returns the value of the argument of YANG <code>error-app-tag</code> keyword.
+ * Returns the error tag, as determined by the application reporting the error.
- * @return string with the application tag, or empty if it was not provided.
+ * @return an error tag.
+ */
+ @NonNull String getErrorTag();
+
+ /**
+ * Returns the value of the argument of YANG {@code error-app-tag} statement.
+ *
+ * @return string with the application error tag, or empty if it was not provided.
*/
Optional<String> getErrorAppTag();
/**
*/
Optional<String> getErrorAppTag();
/**
- * Returns the value of the argument of YANG <code>error-message</code> keyword.
+ * Returns the value of the argument of YANG {@code error-message} statement.
*
* @return string with the error message, or empty if it was not provided.
*/
*
* @return string with the error message, or empty if it was not provided.
*/
return ErrorSeverity.ERROR;
}
return ErrorSeverity.ERROR;
}
+ @Override
+ public final String getErrorTag() {
+ return "invalid-value";
+ }
+
@Override
public final Optional<String> getErrorAppTag() {
return Optional.ofNullable(errorAppTag);
@Override
public final Optional<String> getErrorAppTag() {
return Optional.ofNullable(errorAppTag);