Better error handling for .xlsx import
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user