This commit is contained in:
2020-09-04 19:24:17 +00:00
parent e40b8cfd00
commit e9341ea972
2 changed files with 62 additions and 47 deletions

View File

@@ -264,7 +264,14 @@ namespace AyaNova.Api.Controllers
}
catch (System.Exception ex)
{
return BadRequest(new ApiErrorResponse(ApiErrorCode.API_SERVER_ERROR, null, ex.Message));
//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 reportPreRender (<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));
}
}