forked from fanruan/design
Browse Source
* commit 'e0b5574335e9cf8b3462f387b41177e01909e65e': REPORT-55795 【10.0.19】报错规范——设计器远程设计连接部分 fix REPORT-55795 【10.0.19】报错规范——设计器远程设计连接部分feature/big-screen
superman
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