insertUsed = true;
insert = entry.getValue().iterator().next();
} else {
- throw new RestconfDocumentedException("Insert parameter can be used only once.");
+ throw new RestconfDocumentedException("Insert parameter can be used only once.",
+ RestconfError.ErrorType.PROTOCOL, RestconfError.ErrorTag.BAD_ELEMENT);
}
break;
case "point":
pointUsed = true;
point = entry.getValue().iterator().next();
} else {
- throw new RestconfDocumentedException("Point parameter can be used only once.");
+ throw new RestconfDocumentedException("Point parameter can be used only once.",
+ RestconfError.ErrorType.PROTOCOL, RestconfError.ErrorTag.BAD_ELEMENT);
}
break;
default:
- throw new RestconfDocumentedException("Bad parameter for post: " + entry.getKey());
+ throw new RestconfDocumentedException("Bad parameter for post: " + entry.getKey(),
+ RestconfError.ErrorType.PROTOCOL, RestconfError.ErrorTag.BAD_ELEMENT);
}
}
import org.opendaylight.restconf.common.context.InstanceIdentifierContext;
import org.opendaylight.restconf.common.context.NormalizedNodeContext;
import org.opendaylight.restconf.common.errors.RestconfDocumentedException;
+import org.opendaylight.restconf.common.errors.RestconfError;
import org.opendaylight.restconf.common.errors.RestconfError.ErrorTag;
import org.opendaylight.restconf.common.errors.RestconfError.ErrorType;
import org.opendaylight.restconf.common.validation.RestconfValidationUtils;
}
}
default:
- throw new RestconfDocumentedException("Used bad value of insert parameter. Possible values are "
- + "first, last, before or after, but was: " + insert);
+ throw new RestconfDocumentedException(
+ "Used bad value of insert parameter. Possible values are first, last, before or after, "
+ + "but was: " + insert, RestconfError.ErrorType.PROTOCOL, ErrorTag.BAD_ATTRIBUTE);
}
}
if (dataSchemaNode instanceof ListSchemaNode) {
if (!((ListSchemaNode) dataSchemaNode).isUserOrdered()) {
- throw new RestconfDocumentedException("Insert parameter can be used only with ordered-by user list.");
+ throw new RestconfDocumentedException("Insert parameter can be used only with ordered-by user list.",
+ RestconfError.ErrorType.PROTOCOL, ErrorTag.BAD_ELEMENT);
}
return dataSchemaNode;
}
if (dataSchemaNode instanceof LeafListSchemaNode) {
if (!((LeafListSchemaNode) dataSchemaNode).isUserOrdered()) {
throw new RestconfDocumentedException(
- "Insert parameter can be used only with ordered-by user leaf-list.");
+ "Insert parameter can be used only with ordered-by user leaf-list.",
+ RestconfError.ErrorType.PROTOCOL, ErrorTag.BAD_ELEMENT);
}
return dataSchemaNode;
}
- throw new RestconfDocumentedException("Insert parameter can be used only with list or leaf-list");
+ throw new RestconfDocumentedException("Insert parameter can be used only with list or leaf-list",
+ RestconfError.ErrorType.PROTOCOL, ErrorTag.BAD_ELEMENT);
}
}