Improve startup failures user experience

- Be clear about config errors instead of difficult stack traces
- Fix default values which should not cause startup failures
This commit is contained in:
Maxime Dor
2017-09-03 23:26:22 +02:00
parent 466a3d270e
commit 954dcf3a5c
7 changed files with 39 additions and 7 deletions

View File

@@ -0,0 +1,14 @@
package io.kamax.mxisd.spring;
import io.kamax.mxisd.exception.ConfigurationException;
import org.springframework.boot.diagnostics.AbstractFailureAnalyzer;
import org.springframework.boot.diagnostics.FailureAnalysis;
public class ConfigurationFailureAnalyzer extends AbstractFailureAnalyzer<ConfigurationException> {
@Override
protected FailureAnalysis analyze(Throwable rootFailure, ConfigurationException cause) {
return new FailureAnalysis(cause.getMessage(), "Double check the key value", cause);
}
}