- public RestconfDocumentedException( List<RestconfError> errors ) {
- this.errors = ImmutableList.copyOf( errors );
- Preconditions.checkArgument( !this.errors.isEmpty(), "RestconfError list can't be empty" );
+ public RestconfDocumentedException(String message, Throwable cause, List<RestconfError> errors) {
+ super(message, cause);
+ if(!errors.isEmpty()) {
+ this.errors = ImmutableList.copyOf(errors);
+ } else {
+ this.errors = ImmutableList.of(new RestconfError(RestconfError.ErrorType.APPLICATION,
+ RestconfError.ErrorTag.OPERATION_FAILED, message));
+ }
+