I have bean (don't mind try catch it is for debug purpose):
@Bean
public IgniteEntityConfiguration articleIgniteEntityConfig() {
try {
return IgniteEntityConfiguration.builder()
.cacheName("ArticleCache")
.dbTableName("ARTICLE")
.valueClass(Article.class)
.build();
} catch (Exception e) {
log.error("bean errr", e);
throw e;
}
}
In IgniteEntityConfiguration I validate passed class and thrown exception if needed.
flow
In logs I have:
- Error logged by logger
log.error("bean errr", e);; - Other info lines.
- Error from @Controller that is using bean that intercity uses
articleIgniteEntityConfig; And here app stops.
If I delete try catch block, the error is not even logged (exception is thrown - I checked it with debugger).
question
Why is that? Shouldn't the first exception in beans stop the app?