function dcError(e,t,n,r){function u(){a()}function a(){s={},s.time=(new Date).toISOString(),s.type="error",o={},r?s.data=c():n==null?s.data=f():e==null&&t==null&&(s.data=l())}function f(){if($(e)[0].nodeName){e=e[0],o.deviceID=e.hasAttribute("deviceID")?e.getAttribute("deviceID"):"";var n=e.children||e.childNodes;n&&n.length&&(e=n[0]),o.value=e.hasAttribute("value")?e.getAttribute("value"):"",o.name=e.hasAttribute("name")?e.getAttribute("name"):"",o.causalCall=t.url}else o.errorCode=e.errorCode,o.errorText=e.errorText;return o}function l(){return errData=$(n.responseText)[1].children,o.name=errData[0].textContent,o.value=errData[1].textContent,o}function c(){return o.name=r.name,o.ip=r.ip,o.deviceID=r.deviceID,o}var i,s,o;u()};