0
sergii created
Hi, Could somebody clarify why I get aways "An internal error occurred during your request!" on any kind of exceptions ?
[HttpPost]
public async Task<AjaxResponse> Save()
{
try
{
throw new Exception("Any Exception");
}
catch (AbpValidationException ex)
{
string message = String.Join(Environment.NewLine, ex.ValidationErrors.Select(x => x.ErrorMessage));
result = new AjaxResponse(false)
{
Error = new ErrorInfo("Error occurred while verifying form data", message)
};
}
catch (Exception ex)
{
result = new AjaxResponse(new ErrorInfo("An error occurred while processing form data", ex.Message));
}
return result ?? new AjaxResponse(true);
}
{
__abp: true,
error: {
code: 0,
details: null,
message: "An internal error occurred during your request!",
validationErrors: null
},
result: null,
success: false,
targetUrl: null ,
unAuthorizedRequest: false}
1 Answer(s)
-
0
Hi,
If you are using ASP.NET MVC 5.x, you need to set customErrors to On in web.config, see <a class="postlink" href="http://aspnetboilerplate.com/Pages/Documents/Handling-Exceptions#DocEnableErrorHandling">http://aspnetboilerplate.com/Pages/Docu ... orHandling</a>.
If you are using ASP.NET Core, this is not normal.
Thanks.