feat:register throws error message (#798)

pull/800/head
WuLang 2 years ago committed by GitHub
parent e635aec3e0
commit 28073f8c3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -45,6 +45,7 @@ import org.springframework.context.ApplicationListener;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ThreadPoolExecutor;
import static cn.hippo4j.common.constant.Constants.REGISTER_DYNAMIC_THREAD_POOL_PATH;
@ -89,7 +90,8 @@ public class DynamicThreadPoolConfigService extends AbstractDynamicThreadPoolSer
failDynamicThreadPoolRegisterWrapper(registerWrapper);
Result registerResult = httpAgent.httpPost(REGISTER_DYNAMIC_THREAD_POOL_PATH, registerWrapper);
if (registerResult == null || !registerResult.isSuccess()) {
throw new ServiceException("Dynamic thread pool registration returns error.");
throw new ServiceException("Dynamic thread pool registration returns error."
+ Optional.ofNullable(registerResult).map(Result::getMessage).orElse(""));
}
} catch (Throwable ex) {
log.error("Dynamic thread pool registration execution error: {}", threadPoolId, ex);

Loading…
Cancel
Save