From 882bf07c3f50b71a2aae69e2b3b7698c3633b2a2 Mon Sep 17 00:00:00 2001 From: Pablo Fuentes Date: Sat, 16 Mar 2019 21:46:31 +0100 Subject: [PATCH] [IMP] web_drop_target: Handle FilerReader error --- web_drop_target/static/src/js/web_drop_target.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web_drop_target/static/src/js/web_drop_target.js b/web_drop_target/static/src/js/web_drop_target.js index 1a624580..f5aad33c 100644 --- a/web_drop_target/static/src/js/web_drop_target.js +++ b/web_drop_target/static/src/js/web_drop_target.js @@ -102,6 +102,10 @@ odoo.define('web_drop_target', function(require) { }); }, + _file_reader_error_handler: function(e){ + console.error(e); + }, + _handle_file_drop_attach: function( item, e, res_model, res_id, extra_data ) { @@ -111,6 +115,7 @@ odoo.define('web_drop_target', function(require) { reader.onloadend = self.proxy( _.partial(self._create_attachment, file, reader, e, res_model, res_id, extra_data) ); + reader.onerror = self.proxy('_file_reader_error_handler'); reader.readAsArrayBuffer(file); },