This commit is contained in:
2020-09-09 21:38:43 +00:00
parent 76413455f2
commit 1bc2c29619
3 changed files with 5 additions and 111 deletions

View File

@@ -233,14 +233,9 @@ namespace AyaNova.Api.Controllers
}
catch (System.Exception ex)
{
//Don't send the full stack trace, just the initial error message from the javascript eval
// "Evaluation failed: ReferenceError: reportdata is not defined\n at ayPrepareData (<anonymous>:5:17)\n at ayPreRender (C:\\data\\code\\raven\\server\\AyaNova\\resource\\rpt\\ay-report.js:13:12)\n at __puppeteer_evaluation_script__:10:25"
var v = ex.Message;
// int positionOfNewLine = v.IndexOf("\n at");
// if (positionOfNewLine >= 0)
// v = v.Substring(0, positionOfNewLine);
return BadRequest(new ApiErrorResponse(ApiErrorCode.INVALID_OPERATION, null, v));
//The Javascript evaluation stack trace can be in the message making it long and internalized,
//however the info is useful as it can indicate exactly which function failed etc so sending it all back is best
return BadRequest(new ApiErrorResponse(ApiErrorCode.INVALID_OPERATION, null, ex.Message));
}
}
@@ -355,7 +350,7 @@ namespace AyaNova.Api.Controllers
//fileData in JSON stringify format
FileData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<UploadFileData>>(uploadFormData.FormFieldData["FileData"].ToString());
//Instantiate the business object handler
ReportBiz biz = ReportBiz.GetBiz(ct, HttpContext);