Question about error handling. In `ErrorManagement...
# suitecommerce
c
Question about error handling. In
ErrorManagement.js
there is a comment "// You can bypass all this logic by capturing the error callback on the fetch using preventDefault = true on your jqXhr object". My question is: How can I set
preventDefault: true
on a front-end backbone model? I've tried multiple ways of passing this property in the
options
object, but it never carries up to the
ErrorManagement
module.
m
Hey Chris, what version of SCA do you have?
c
This is on 2019.1
m
Can you share the reference file for ErrorManagment.js? I dont have that version on me
c
Do you mean paste the file contents here?
m
if you can’t attach the file, do a paste bin or something like that
c
Well, there's this at the top:
Copy code
/*
	© 2019 NetSuite Inc.
	User may not copy, modify, distribute, or re-bundle or otherwise make available this code;
	provided, however, if you are an authorized user with a NetSuite account or log-in, you
	may use this code subject to the terms that govern your access and use.
*/
I'm pretty open to copy/paste my own stuff, but Uncle Larry's code...
m
hahaha you’re right! give me a sec, let me find the file by myself
Copy code
promise.error(function (jqXhr)
{
    var message = ErrorManagement.parseErrorMessage(jqXhr, self.application.getLayout().errorMessageKeys);
    jqXhr.preventDefault = true;
    self.showError(message);

    parent_view && parent_view.disableButtons(false);
});
found a website on that version; also found that code and works
c
Going to try that.
👍🏻 1