Commit 79922302 authored by Savorboard's avatar Savorboard

add exception log if storage structure failed. #337

parent 4c870f42
...@@ -35,7 +35,14 @@ namespace DotNetCore.CAP ...@@ -35,7 +35,14 @@ namespace DotNetCore.CAP
{ {
_logger.LogDebug("### CAP background task is starting."); _logger.LogDebug("### CAP background task is starting.");
await Storage.InitializeAsync(stoppingToken); try
{
await Storage.InitializeAsync(stoppingToken);
}
catch (Exception e)
{
_logger.LogError(e, "Initializing the storage structure failed!");
}
stoppingToken.Register(() => stoppingToken.Register(() =>
{ {
...@@ -53,11 +60,11 @@ namespace DotNetCore.CAP ...@@ -53,11 +60,11 @@ namespace DotNetCore.CAP
} }
} }
}); });
await BootstrapCoreAsync(); await BootstrapCoreAsync();
_logger.LogInformation("### CAP started!"); _logger.LogInformation("### CAP started!");
} }
protected virtual Task BootstrapCoreAsync() protected virtual Task BootstrapCoreAsync()
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment