- 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) {
+ // FIXME: We override getMessage so supplied message is lost for any public access
+ // this was lost also in original code.
+ super(cause);
+ if(!errors.isEmpty()) {
+ this.errors = ImmutableList.copyOf(errors);
+ } else {
+ this.errors = ImmutableList.of(new RestconfError(RestconfError.ErrorType.APPLICATION,
+ RestconfError.ErrorTag.OPERATION_FAILED, message));
+ }
+