diff --git a/src/components/views/dialogs/AskInviteAnywayDialog.js b/src/components/views/dialogs/AskInviteAnywayDialog.js index 7fa6069478..120ad8deca 100644 --- a/src/components/views/dialogs/AskInviteAnywayDialog.js +++ b/src/components/views/dialogs/AskInviteAnywayDialog.js @@ -72,7 +72,7 @@ export default createReactClass({ - diff --git a/src/components/views/dialogs/InviteDialog.js b/src/components/views/dialogs/InviteDialog.js index 20c8fb5b14..e8c39b6d5a 100644 --- a/src/components/views/dialogs/InviteDialog.js +++ b/src/components/views/dialogs/InviteDialog.js @@ -564,7 +564,7 @@ export default class InviteDialog extends React.PureComponent { return; } - const createRoomOptions = {}; + const createRoomOptions = {inlineErrors: true}; if (SettingsStore.isFeatureEnabled("feature_cross_signing")) { // Check whether all users have uploaded device keys before. diff --git a/src/createRoom.js b/src/createRoom.js index 07eaee3e8f..45e849065d 100644 --- a/src/createRoom.js +++ b/src/createRoom.js @@ -37,6 +37,8 @@ import SettingsStore from "./settings/SettingsStore"; * Default: True * @param {bool=} opts.encryption Whether to enable encryption. * Default: False + * @param {bool=} opts.inlineErrors True to raise errors off the promise instead of resolving to null. + * Default: False * * @returns {Promise} which resolves to the room id, or null if the * action was aborted or failed. @@ -140,6 +142,9 @@ export default function createRoom(opts) { } return roomId; }, function(err) { + // Raise the error if the caller requested that we do so. + if (opts.inlineErrors) throw err; + // We also failed to join the room (this sets joining to false in RoomViewStore) dis.dispatch({ action: 'join_room_error',