package org.springblade.core.tool.exception;

import org.springblade.core.tool.api.IResultCode;
import org.springblade.core.tool.api.ResultCode;

import lombok.Getter;


/**
 * RPC调用异常
 *
 * @author Chill
 */
public class RpcException extends RuntimeException {
	private static final long serialVersionUID = 2359767895161832954L;

	@Getter
	private final IResultCode resultCode;

	public RpcException(String message) {
		super(message);
		this.resultCode = ResultCode.FAILURE;
	}
	
	public RpcException(String message, Throwable cause) {
		super(message, cause);
		this.resultCode = ResultCode.FAILURE;
	}

	/**
	 * 提高性能
	 *
	 * @return Throwable
	 */
	@Override
	public Throwable fillInStackTrace() {
		return this;
	}

	public Throwable doFillInStackTrace() {
		return super.fillInStackTrace();
	}

}
