Version 3.5.0 - Failing to Wrap Error Messages in Json.
See original GitHub issueVersion: 3.5.0 Base Framework: .NET Framework, jQuery MVC Steps needed to reproduce: Using the base template code provided for login, enter an invalid password for login. An HTML page is returned by the boilerplate and not a JSON with the error.
I can not get the boilerplate to return any UserFriendlyMessages, or really any errors for that matter, as a JSON. No matter how the request is done the return type of the method (ActionResult vs. JsonResult), the error is always sent back as an HTML page. This causes the boilerplate on AJAX calls to show an error message saying “Error Detail Not Sent By Server.” The HTML error response is correct with the correct exception, though it will never wrap it in JSON no matter the request or return type of the controller. This seems to be the case from the base template code or my own ajax and controller method I write.
I have attempted to upgrade to newer versions of Abp through the package manager to see if it was by chance fixed in later versions, though ran into issues of failing to load an assembly of System.ComponetModel when I attempted to run again, so I have reverted those changes back.
Was this issue and been solved in updated versions?
The following for login in Login.js:
abp.ui.setBusy(
$('#LoginArea'),
abp.ajax({
contentType: 'application/x-www-form-urlencoded',
url: $loginForm.attr('action'),
data: $loginForm.serialize()
})
);
With the following method signature in the controller:
public async Task<JsonResult> Login(LoginViewModel loginModel, string returnUrl = "", string returnUrlHash = "")
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (5 by maintainers)
Top GitHub Comments
@ismcagdas Ahh yep that was it! The default template has it set to
RemoteOnly
which explains why I was not seeing Abp handle it properly locally.@chadsmith12 what is the value of customErrors in the web.config ?