Consolidate status markup.
Improved charting error reporting.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user