mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-22 06:22:50 +08:00
Fix configuration error, throw error message (#522)
Fix configuration error, throw error message
This commit is contained in:
parent
0f68f18060
commit
46132b6fa8
@ -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>();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user