From 026d8b7d1c73f3082a22e7034e40500aeb47c93d Mon Sep 17 00:00:00 2001 From: Adam Eivy Date: Mon, 21 Apr 2014 16:57:10 -0700 Subject: [PATCH] adding the optional error callbacks to log issues with filesystem API --- src/javascripts/DownloadBuilder.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/javascripts/DownloadBuilder.js b/src/javascripts/DownloadBuilder.js index bddc66d..ccde992 100644 --- a/src/javascripts/DownloadBuilder.js +++ b/src/javascripts/DownloadBuilder.js @@ -581,7 +581,10 @@ // LOCAL VARIABLES var self = this, - blob; + blob, + onError = function(data){ + console.log('error writing to filesystem',data); + }; // Request temporary storage data (even though we are not creating any files this step is necessary) window.storageInfo.requestQuota(1024*1024, function(grantedBytes) { @@ -601,13 +604,13 @@ // Calls the callback function that was passed in, and constructs then passes the url that references the recently created blob obj.callback.call(window, window.URL.createObjectURL(blob)); - }); + },onError); - }); + },onError); - }); + },onError); - }); + },onError); // Maintains chainability return this;