JavaScript Exception/Error Handling Not Working -
It may be a little difficult to follow.
I have found a function inside an object:
f_openFRHandler: function (input) {console.debug ('f_openFRHandler'); Try {// throw 'foo'; DragDrop.FileChanged (input); //foxyface.window.close (); } Hold (e) {console.error (e); ('# Foxyface_open_errors'). (* & Lt; div & gt; reached maximum local storage limit, unable to store new images in your browser. Please remove some images and try again. & Lt; / div & gt; '); }},
Try calling it:
this.FileChanged = function {input} {// FileUploadManager.addFileInput (input); Console.debug (input); Var file = input.files; (Var i = 0; i & lt; files.length; i ++) for {var file = files [i]; If (! File.type.match (/ image. * /) Will continue; Var Reader = New FileReader (); Reader.onload = (Function (F, EastLast) {Return Function (E) {if (files.length == 1) {LocalStorageManager.addImage (f.name, e.target.result, false, true); LocalRost Manager Load Current Image (); //foxyface.window.close ();} {{FileUploadManager.addFileData (f, e.target.result); // is to add multiple files to the list (if it is) set timeout (function ( ) {LocalStorageManager.loadCurrentImage ()}, 100);}};}) (file, i == files.length - 1); Reader.readAsDataURL (file); } Back true;
LocalStorageManager.addImage call:
this.setItem = function (data) {localStorage.setItem ('ImageStore', $ .json_encode (data)) ; }
If the local storage is used then the local error is a threshold. I want to catch that error in f_openFRHandler (the first code sample), but it is being sent to the error console instead of the grip block I am trying to ensure the following code in my firebug console that I am not mad And despite many levels of function nesting it works:
try {(function () ({function ()} {throw 'foo}}) ()}) ()} hold ( E) {console.debug (e)} /
var reader = new FileReader (); R Eader.onload = (function (f, isLast) {/ code>
Probably this is your problem - the fileorder probably makes asynchronous calls at that time, when your attempt / hold is no longer in the area. FileReader Interface There may be a different error handler function available on, or you may need to move the try / hand of that anonymous function which you send to oddre.)
Comments
Post a Comment