Consolidate status markup.

Improved charting error reporting.
This commit is contained in:
2017-02-24 10:44:13 -05:00
parent 61cbc942c1
commit 3ff815082a
12 changed files with 119 additions and 72 deletions
+7 -6
View File
@@ -71,15 +71,15 @@ namespace LeafWeb.WebCms.Controllers
}
catch (ParseException e)
{
return new HttpStatusCodeResult(HttpStatusCode.NotFound, e.Message);
}
return new HttpStatusCodeResult(HttpStatusCode.NotFound, $"Parse exception in {leafOutputFile.Filename}. {e.Message}" );
}
catch (Exception)
{
return new HttpStatusCodeResult(HttpStatusCode.NotFound);
return new HttpStatusCodeResult(HttpStatusCode.NotFound, $"Unhandled exception thrown wihle parsing {leafOutputFile.Filename}.");
}
if (curveData == null)
return new HttpStatusCodeResult(HttpStatusCode.NotFound);
return new HttpStatusCodeResult(HttpStatusCode.NotFound, $"No curve data was loaded from {leafOutputFile.Filename}.");
var charts = GetChartBitmaps(curveData).ToList();
@@ -91,7 +91,9 @@ namespace LeafWeb.WebCms.Controllers
{
combinedChart.Save(ms, ImageFormat.Png);
ms.Seek(0, SeekOrigin.Begin);
return File(ms.ToArray(), "image/png", curveId.FilterValidFilename() + ".png");
var base64String = Convert.ToBase64String(ms.ToArray());
return Content(base64String, "image/png");
//return File(ms.ToArray(), "image/png", curveId.FilterValidFilename() + ".png");
}
}
@@ -109,7 +111,6 @@ namespace LeafWeb.WebCms.Controllers
LogManager.GetLogger(GetType()).Warn(e);
throw;
}
//return null;
}
private string[] GetCurveIds(byte[] fileContents)