I have a form submitting data and waiting for a json response but some errors/warnings/notices on PHP raises a javascript Exception when form tries to parse the responseText into JSON.
Is there a way to catch the error or perform my validation before form does?
I tried overriding Ext.JSON.decode, but for some reason form doesn't use that definition even when console error shows as follow
Uncaught Ext.JSON.decode(): You're trying to decode an invalid JSON String: my wrong json test!! ext-all.js:21
Ext.Error.Ext.extend.statics.raise ext-all.js:21
Ext.JSON.me.decode ext-all.js:21 <-- why Ext.JSON.[me].decode?
Ext.define.handleResponse ext-all.js:21
Ext.define.processResponse ext-all.js:21
Ext.define.onSuccess ext-all.js:21
Ext.apply.callback ext-all.js:21
Ext.define.onComplete ext-all.js:21
Ext.define.onStateChange ext-all.js:21
(anonymous function)
Any idea? Thanks in advance.