diff --git a/Web/Controllers/CreateLogController.cs b/Web/Controllers/CreateLogController.cs index 035f20a..a4fe23c 100644 --- a/Web/Controllers/CreateLogController.cs +++ b/Web/Controllers/CreateLogController.cs @@ -187,6 +187,11 @@ namespace MileageTraker.Web.Controllers // todo: delete file? return View(logImports.ToList()); } + catch (OutOfMemoryException) + { + TempData["StatusMessage"] = "Problem reading excel document - please verify that the document is in Excel 97-2003 Workbook (.xls) format"; + TempData["StatusMessage-Type"] = "alert-error"; + } catch (Exception ex) { TempData["StatusMessage"] = "Problem reading excel document: " + ex.Message; diff --git a/Web/Controllers/LogController.cs b/Web/Controllers/LogController.cs index 94a6158..6ee473a 100644 --- a/Web/Controllers/LogController.cs +++ b/Web/Controllers/LogController.cs @@ -266,6 +266,11 @@ namespace MileageTraker.Web.Controllers // todo: delete file? return View(logImports.ToList()); } + catch (OutOfMemoryException) + { + TempData["StatusMessage"] = "Problem reading excel document - please verify that the document is in Excel 97-2003 Workbook (.xls) format"; + TempData["StatusMessage-Type"] = "alert-error"; + } catch (Exception ex) { TempData["StatusMessage"] = "Problem reading excel document: " + ex.Message;