Fix configuration error, throw error message (#522)

Fix configuration error, throw error message
This commit is contained in:
aqa510415008 2018-08-02 06:54:01 +08:00 committed by Tom Pallister
parent 0f68f18060
commit 46132b6fa8

View File

@ -118,6 +118,11 @@
// now create the config // now create the config
var internalConfigCreator = builder.ApplicationServices.GetService<IInternalConfigurationCreator>(); var internalConfigCreator = builder.ApplicationServices.GetService<IInternalConfigurationCreator>();
var internalConfig = await internalConfigCreator.Create(fileConfig.Value); var internalConfig = await internalConfigCreator.Create(fileConfig.Value);
//Configuration error, throw error message
if (internalConfig.IsError)
{
ThrowToStopOcelotStarting(internalConfig);
}
// now save it in memory // now save it in memory
var internalConfigRepo = builder.ApplicationServices.GetService<IInternalConfigurationRepository>(); var internalConfigRepo = builder.ApplicationServices.GetService<IInternalConfigurationRepository>();