add db connect logging

This commit is contained in:
Luke Pulverenti 2016-05-23 13:51:49 -04:00
parent 91aab66857
commit 93bf60c9e2
1 changed files with 11 additions and 2 deletions

View File

@ -54,9 +54,18 @@ namespace MediaBrowser.ServerApplication.Native
_logger = logger;
}
public Task<IDbConnection> Connect(string dbPath)
public async Task<IDbConnection> Connect(string dbPath)
{
return SqliteExtensions.ConnectToDb(dbPath, _logger);
try
{
return await SqliteExtensions.ConnectToDb(dbPath, _logger).ConfigureAwait(false);
}
catch (Exception ex)
{
_logger.ErrorException("Error opening database {0}", ex, dbPath);
throw;
}
}
}
}