Browse Source
Merge in DESIGN/design from ~HADES/design:feature/10.0 to feature/10.0 * commit '7268eacb44028581cf038679880e834ad3f85a4d': REPORT-55795 【10.0.19】报错规范——设计器远程设计连接部分 fix REPORT-55795 【10.0.19】报错规范——设计器远程设计连接部分feature/10.0
Hades
3 years ago
9 changed files with 79 additions and 27 deletions
@ -0,0 +1,28 @@
|
||||
package com.fr.env.handler; |
||||
|
||||
/** |
||||
* |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2021/8/11 |
||||
*/ |
||||
public class RefWrapper { |
||||
|
||||
private final Throwable throwable; |
||||
|
||||
private final String link; |
||||
|
||||
|
||||
public RefWrapper(Throwable throwable, String link) { |
||||
this.throwable = throwable; |
||||
this.link = link; |
||||
} |
||||
|
||||
public Throwable getThrowable() { |
||||
return throwable; |
||||
} |
||||
|
||||
public String getLink() { |
||||
return link; |
||||
} |
||||
} |
@ -1,18 +1,22 @@
|
||||
package com.fr.env.handler.impl; |
||||
|
||||
import com.fr.env.handler.Handler; |
||||
import com.fr.env.handler.RefWrapper; |
||||
import com.fr.env.handler.ResultWrapper; |
||||
import java.util.concurrent.CancellationException; |
||||
|
||||
/** |
||||
* 取消测试连接时的处理器 |
||||
* |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2021/8/5 |
||||
*/ |
||||
public class CancelHandler implements Handler<Throwable, ResultWrapper> { |
||||
public class CancelHandler implements Handler<RefWrapper, ResultWrapper> { |
||||
|
||||
@Override |
||||
public ResultWrapper handle(Throwable e) { |
||||
public ResultWrapper handle(RefWrapper wrapper) { |
||||
Throwable e = wrapper.getThrowable(); |
||||
return new ResultWrapper(!(e instanceof CancellationException), e); |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue