Add exception handling to products display

This commit is contained in:
Michael Bucari-Tovo 2022-05-26 16:29:40 -06:00
parent 15b6a66d98
commit 845af854bd

View File

@ -83,6 +83,8 @@ namespace LibationWinForms.GridView
#region UI display functions
public void Display()
{
try
{
// don't return early if lib size == 0. this will not update correctly if all books are removed
var lib = DbContexts.GetLibrary_Flat_NoTracking();
@ -96,6 +98,11 @@ namespace LibationWinForms.GridView
}
else
productsGrid.UpdateGrid(lib);
}
catch (Exception ex)
{
Serilog.Log.Error(ex, "Error displaying library in {0}", nameof(ProductsDisplay));
}
}