Skip to content

Commit ab1db35

Browse files
committed
Exception is thrown when component failed to register
Signed-off-by: JermaineHua <crazyhzm@apache.org>
1 parent c53e51c commit ab1db35

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

sofa-boot-project/sofa-boot-core/runtime-sofa-boot/src/main/java/com/alipay/sofa/runtime/impl/ComponentManagerImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ private ComponentInfo doRegister(ComponentInfo ci) {
187187
ci.register();
188188
} catch (Throwable t) {
189189
LOGGER.error(ErrorCode.convert("01-03003", ci.getName()), t);
190-
return null;
190+
throw new ServiceRuntimeException(ErrorCode.convert("01-03003", ci.getName()));
191191
}
192192

193193
LOGGER.info("Registering component: {}", ci.getName());
@@ -209,6 +209,7 @@ private ComponentInfo doRegister(ComponentInfo ci) {
209209
} catch (Throwable t) {
210210
ci.exception(new Exception(t));
211211
LOGGER.error(ErrorCode.convert("01-03004", ci.getName()), t);
212+
throw new ServiceRuntimeException(ErrorCode.convert("01-03004", ci.getName()));
212213
}
213214

214215
return ci;

0 commit comments

Comments
 (0)