public String getErrorId() { return context.getErrorId(); }
public String getErrorIdWithIdentity() { final NodeEndpoint endpoint = context.getEndpoint(); if (endpoint == null ) { return "ErrorId: " + context.getErrorId(); } else { return "ErrorId: " + context.getErrorId() + " on " + endpoint.getAddress() + ":" + endpoint.getUserPort(); } }
/** * returns or creates a DremioPBError object corresponding to this user exception. * * @param verbose should the error object contain the verbose error message ? * @return protobuf error object */ public DremioPBError getOrCreatePBError(final boolean verbose) { final DremioPBError.Builder builder = DremioPBError.newBuilder(); builder.setErrorType(errorType); builder.setErrorId(context.getErrorId()); if (context.getEndpoint() != null) { builder.setEndpoint(context.getEndpoint()); } builder.setMessage(getVerboseMessage()); builder.setOriginalMessage(getOriginalMessage()); if (getCause() != null) { // some unit tests use this information to make sure a specific exception was thrown in the server builder.setException(ErrorHelper.getWrapper(getCause())); } builder.addAllContext(context.getContextAsStrings()); if (rawAdditionalContext != null) { builder.setTypeSpecificContext(rawAdditionalContext); } return builder.build(); }