mirror of https://github.com/ZhongFuCheng3y/austin
parent
1ddece43fe
commit
b658333300
@ -0,0 +1,39 @@
|
||||
package com.java3y.austin.support.exception;
|
||||
|
||||
import com.java3y.austin.common.enums.RespStatusEnum;
|
||||
import com.java3y.austin.support.pipeline.ProcessContext;
|
||||
|
||||
/**
|
||||
* @author SamLee
|
||||
* @since 2022-03-29
|
||||
*/
|
||||
public class ProcessException extends RuntimeException {
|
||||
|
||||
/**
|
||||
* 流程处理上下文
|
||||
*/
|
||||
private final ProcessContext processContext;
|
||||
|
||||
public ProcessException(ProcessContext processContext) {
|
||||
super();
|
||||
this.processContext = processContext;
|
||||
}
|
||||
|
||||
public ProcessException(ProcessContext processContext, Throwable cause) {
|
||||
super(cause);
|
||||
this.processContext = processContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
if (this.processContext != null) {
|
||||
return this.processContext.getResponse().getMsg();
|
||||
} else {
|
||||
return RespStatusEnum.CONTEXT_IS_NULL.getMsg();
|
||||
}
|
||||
}
|
||||
|
||||
public ProcessContext getProcessContext() {
|
||||
return processContext;
|
||||
}
|
||||
}
|
Loading…
Reference in new issue