colesico.framework.rpc.RpcError Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of colesico-rpc Show documentation
Show all versions of colesico-rpc Show documentation
Colesico framework Remote Procedure Call for Services
The newest version!
package colesico.framework.rpc;
public class RpcError {
private String exceptionType;
private String message;
public RpcError() {
}
public RpcError(String exceptionType, String message) {
this.exceptionType = exceptionType;
this.message = message;
}
public static RpcError of(String message) {
return new RpcError(RpcException.class.getCanonicalName(), message);
}
public static RpcError of(Class extends Throwable> exceptionType) {
return new RpcError(exceptionType.getCanonicalName(), null);
}
public static RpcError of(String exceptionType, String message) {
return new RpcError(exceptionType, message);
}
public static RpcError of(Class extends Throwable> exceptionType, String message) {
return new RpcError(exceptionType.getCanonicalName(), message);
}
public String getExceptionType() {
return exceptionType;
}
public void setExceptionType(String exceptionType) {
this.exceptionType = exceptionType;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@Override
public String toString() {
return "RpcError{" +
"exceptionType='" + exceptionType + '\'' +
", message='" + message + '\'' +
'}';
}
}