mirror of
https://github.com/slhaf/Partner.git
synced 2026-05-12 16:53:04 +08:00
refactor(core): migrate deprecated exceptions to new hierarchy and align tests
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
package work.slhaf.partner.framework.agent.exception.deprecated;
|
||||
|
||||
@Deprecated
|
||||
public class AgentLaunchFailedException extends RuntimeException {
|
||||
public AgentLaunchFailedException(String message, Throwable cause) {
|
||||
super("Agent 启动失败 " + message, cause);
|
||||
}
|
||||
|
||||
public AgentLaunchFailedException(String message) {
|
||||
super("Agent 启动失败 " + message);
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package work.slhaf.partner.framework.agent.exception.deprecated;
|
||||
|
||||
@Deprecated
|
||||
public class AgentRunningFailedException extends AgentRuntimeException {
|
||||
public AgentRunningFailedException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public AgentRunningFailedException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package work.slhaf.partner.framework.agent.exception.deprecated;
|
||||
|
||||
@Deprecated
|
||||
public class AgentRuntimeException extends RuntimeException {
|
||||
public AgentRuntimeException(String message) {
|
||||
super("Agent 执行出错 " + message);
|
||||
}
|
||||
|
||||
public AgentRuntimeException(String message, Throwable cause) {
|
||||
super("Agent 执行出错 " + message, cause);
|
||||
}
|
||||
}
|
||||
@@ -21,9 +21,8 @@ class Result<T> private constructor(
|
||||
return value as T
|
||||
}
|
||||
when (exception) {
|
||||
is RuntimeException -> throw exception
|
||||
is Error -> throw exception
|
||||
else -> throw IllegalStateException(exception.message, exception)
|
||||
is AgentRuntimeException, is Error -> throw exception
|
||||
else -> throw AgentRuntimeException(exception.localizedMessage, exception)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user