Catching error during loadStruct

is there a way to catch an error here

myform.loadStruct("/xml/login.json", function(){

Not an parsing error in login.json - a load error from server (i.e. file is not available)

You may try to use the onAjaxError event:
https://docs.dhtmlx.com/api__dhtmlxajax_onajaxerror_event.html