abp.jquery.ajax can't display error message
See original GitHub issueHi. I’m using abp.jquery to send a ajax request.now,I remove admin role from swagger ui,then can return a message “Static roles can not be deleted.”,this is correct.if I using abp.jquery.ajax to send it .this will return “An error has occurred! Error detail not sent by server.”,I think problem is here.
return $.Deferred(function ($dfd) {
$.ajax(options)
.done(function (data, textStatus, jqXHR) {
if (data.__abp) {
abp.ajax.handleResponse(data, userOptions, $dfd, jqXHR);
} else {
$dfd.resolve(data);
userOptions.success && userOptions.success(data);
}
}).fail(function (jqXHR) {
//problem here.
if (jqXHR.responseJSON && jqXHR.responseJSON.__abp) {
abp.ajax.handleResponse(jqXHR.responseJSON, userOptions, $dfd, jqXHR);
} else {
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd);
}
});
});
How can I return a correct message from abp.jquery.ajax?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
jquery - AJAX error message not displayed (success ...
I am setting up a add/remove dynamic input field using JQUERY/AJAX. I am a beginner with coding and this is my first time...
Read more >ASP.NET Core MVC / Razor Pages UI JavaScript AJAX API
abp.ajax API provides a convenient way of performing AJAX calls to the server. It internally uses JQuery's $.ajax, but automates some common tasks...
Read more >jQuery.ajax()
A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with...
Read more >abp.ajax
As you can see, success is false and result is null. abp.ajax handles this object and shows an error message to the user...
Read more >Returning Server-Side Errors from AJAX Calls
Here's the simplest way to integrate custom server-side error messages with your jQuery AJAX calls.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Follow code is my ajax request
if I remove admin or user ,.here will define an error.(“An error has occurred! Error detail not sent by server.”)
F12 check chrome-devtools network xhr will find DeleteRole request. chinese message is “Static roles can not be deleted”,here is correct , but then will show this error,I want to diaplay “Static roles can not be deleted”
Can you write your code here?