Open Closed

how to get data object from abp BusinessException error detail #4152


User avatar
0
ElifKaya created

Hi,

ABP show a BusinessException detail in console. But I can not get a data object from modal.js. I used abp modal and I throw BusinessException, then I need to requestId in my modal.js file. I want to get error data which I marked in the picture on javascript file. Your previous answer was not sufficient for my question. Can you help about this? Thanks

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.

If you're creating a bug/problem report, please include followings:

ABP Framework version: v5.3.3

UI type: Blazor

DB provider: EF Core

Tiered (MVC) or Identity Server Separated (Angular): yes / no

Exception message and stack trace:

Steps to reproduce the issue:"


4 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    What's content of your modal.js?

  • User Avatar
    0
    ElifKaya created

    hi

    What's content of your modal.js?

    I used modal submit form, then I throw Business Exception with object parameter from backend. Then I need to get this error data object(data-requestId). I can see this data in console log, but I can not reach detail of error data in modal.js file.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    _yourModal.onOpen(function () {
        _yourModal.getForm().abpAjaxForm({
            error: function (jqXhr) {
                var error = jqXhr.responseJSON.error;
    
                return false;
            }
        });
    })
    
  • User Avatar
    0
    ElifKaya created

    hi

    _yourModal.onOpen(function () { 
        _yourModal.getForm().abpAjaxForm({ 
            error: function (jqXhr) { 
                var error = jqXhr.responseJSON.error; 
     
                return false; 
            } 
        }); 
    }) 
    

    thank you :)

Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09