Error callback for asyncronous operations

dusanmiloradovic asked for this feature about 5 years ago — 3 comments

dusanmiloradovic commented about 5 years ago

Currently , alasql just throws errors from asynchronous blocks, and they are impossible to catch from the front-end, so the error handling is non-existent in such cases. Sometimes, in case of indexeddb strange errors and blocks are happening, and are very hard to debug. Having the error callback would make this much easier. This feature should not be hard to implement, either add a new callback argument for errors in the definitions of functions, or just call the existing callback with the error, and let the user handle it

mathiasrw commented almost 5 years ago Admin

What about the promise notation - does this help you out? alasql.promise('SELECT * FROM XLS("mydata.xls") WHERE lastname LIKE "A%" and city = "London" GROUP BY name ') .then(function(res){ console.log(res); // output depends on mydata.xls }).catch(function(err){ console.log('Does the file exists? there was an error:', err); });

amontezumag commented over 4 years ago

Does the promise notation also work for WRITING XLS files?

Join the discussion!

with GitHub to comment