From 35fcb2c9abddd1cf1e14875f548b647c557039c1 Mon Sep 17 00:00:00 2001 From: Richard Lewis Date: Thu, 29 Mar 2018 16:56:02 +0100 Subject: [PATCH] Catch rather than 'done' error handler. --- src/components/structures/RoomView.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index f531b94788..6fc16b9760 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -916,7 +916,7 @@ module.exports = React.createClass({ ContentMessages.sendContentToRoom( file, this.state.room.roomId, MatrixClientPeg.get(), - ).done(undefined, (error) => { + ).catch((error) => { if (error.name === "UnknownDeviceError") { // Let the staus bar handle this return; @@ -925,7 +925,8 @@ module.exports = React.createClass({ console.error("Failed to upload file " + file + " " + error); Modal.createTrackedDialog('Failed to upload file', '', ErrorDialog, { title: _t('Failed to upload file'), - description: ((error && error.message) ? error.message : _t("Server may be unavailable, overloaded, or the file too big")), + description: ((error && error.message) + ? error.message : _t("Server may be unavailable, overloaded, or the file too big")), }); }); },