Improve error logging/reporting in megolm import/export

I saw a rageshake where somebody had apparently failed to import a key file.
I have no idea why it happened.

Also try to make the errors the users see useful.
This commit is contained in:
Richard van der Hoff 2017-06-08 14:21:25 +01:00
parent b16e652acc
commit 175599beda
4 changed files with 129 additions and 56 deletions

View file

@ -89,11 +89,13 @@ export default React.createClass({
// TODO: it would probably be nice to give some feedback about what we've imported here.
this.props.onFinished(true);
}).catch((e) => {
console.error("Error importing e2e keys:", e);
if (this._unmounted) {
return;
}
const msg = e.friendlyText || _t('Unknown error');
this.setState({
errStr: e.message,
errStr: msg,
phase: PHASE_EDIT,
});
});