- super(message, cause);
-
- if( errors != null && errors.length > 0 ) {
- errorList = ImmutableList.<RpcError>builder().addAll( Arrays.asList( errors ) ).build();
- }
- else {
- // Add a default RpcError.
- errorList = ImmutableList.of(RpcResultBuilder.newError(ErrorType.APPLICATION, null,
- getMessage(), null, null, getCause()));
- }
- }
-
- /**
- * Returns additional error information about this exception.
- *
- * @return a List of RpcErrors. There is always at least one RpcError.
- */
- public List<RpcError> getErrorList() {
- return errorList;
- }
-
- @Override
- public String getMessage() {
- return new StringBuilder( super.getMessage() ).append(", errors: ").append( errorList ).toString();