# HG changeset patch # User Nicholas Jillings # Date 1435745480 -3600 # Node ID 96a6cea228b389acc6d119ba94f588973669455e # Parent f69f7957979ba480e988f45766c4a94e1a9711c1 Bug Fix #1313: Added 404 crash and dump when audioObject cannot obtain URL. diff -r f69f7957979b -r 96a6cea228b3 core.js --- a/core.js Wed Jul 01 10:21:52 2015 +0100 +++ b/core.js Wed Jul 01 11:11:20 2015 +0100 @@ -637,6 +637,29 @@ } } +function errorSessionDump(msg){ + // Create the partial interface XML save + // Include error node with message on why the dump occured + var xmlDoc = interfaceXMLSave(); + var err = document.createElement('error'); + err.textContent = msg; + xmlDoc.appendChild(err); + var parent = document.createElement("div"); + parent.appendChild(xmlDoc); + var file = [parent.innerHTML]; + var bb = new Blob(file,{type : 'application/xml'}); + var dnlk = window.URL.createObjectURL(bb); + var a = document.createElement("a"); + a.hidden = ''; + a.href = dnlk; + a.download = "save.xml"; + a.textContent = "Save File"; + + popup.showPopup(); + popup.popupContent.innerHTML = "ERROR : "+msg; + popup.popupContent.appendChild(a); +} + // Only other global function which must be defined in the interface class. Determines how to create the XML document. function interfaceXMLSave(){ // Create the XML string to be exported with results @@ -888,6 +911,12 @@ if (audioObj.state == 0 || audioObj.buffer == undefined) { // Genuine error console.log('FATAL - Error loading buffer on '+audioObj.id); + if (request.status == 404) + { + console.log('FATAL - Fragment '+audioObj.id+' 404 error'); + console.log('URL: '+audioObj.url); + errorSessionDump('Fragment '+audioObj.id+' 404 error'); + } } }); }; @@ -1975,5 +2004,4 @@ } return true; }; -} - +} \ No newline at end of file diff -r f69f7957979b -r 96a6cea228b3 index.html --- a/index.html Wed Jul 01 10:21:52 2015 +0100 +++ b/index.html Wed Jul 01 11:11:20 2015 +0100 @@ -25,7 +25,8 @@