[FIX] Fix calls to bugsnag.notify (#1165)

This commit is contained in:
Djorkaeff Alexandre 2019-08-30 09:43:23 -03:00 committed by Diego Mello
parent 0ac1028865
commit c7791b9a38
7 changed files with 28 additions and 29 deletions

View File

@ -310,8 +310,8 @@ class MessageActions extends React.Component {
try { try {
await RocketChat.reportMessage(actionMessage._id); await RocketChat.reportMessage(actionMessage._id);
Alert.alert(I18n.t('Message_Reported')); Alert.alert(I18n.t('Message_Reported'));
} catch (err) { } catch (e) {
log(err); log(e);
} }
} }
@ -327,8 +327,8 @@ class MessageActions extends React.Component {
if (!translatedMessage) { if (!translatedMessage) {
await RocketChat.translateMessage(actionMessage, room.autoTranslateLanguage); await RocketChat.translateMessage(actionMessage, room.autoTranslateLanguage);
} }
} catch (err) { } catch (e) {
log(err); log(e);
} }
} }

View File

@ -293,7 +293,7 @@ class MessageBox extends Component {
try { try {
RocketChat.executeCommandPreview(command, params, rid, item); RocketChat.executeCommandPreview(command, params, rid, item);
} catch (e) { } catch (e) {
log('onPressCommandPreview', e); log(e);
} }
} }
@ -468,7 +468,7 @@ class MessageBox extends Component {
this.setState({ commandPreview: preview.items }); this.setState({ commandPreview: preview.items });
} catch (e) { } catch (e) {
this.showCommandPreview = false; this.showCommandPreview = false;
log('command Preview', e); log(e);
} }
} }
@ -546,9 +546,9 @@ class MessageBox extends Component {
mime: res.type, mime: res.type,
path: res.uri path: res.uri
}); });
} catch (error) { } catch (e) {
if (!DocumentPicker.isCancel(error)) { if (!DocumentPicker.isCancel(e)) {
log('chooseFile', error); log(e);
} }
} }
} }
@ -655,7 +655,7 @@ class MessageBox extends Component {
const messageWithoutCommand = message.substr(message.indexOf(' ') + 1); const messageWithoutCommand = message.substr(message.indexOf(' ') + 1);
RocketChat.runSlashCommand(command, roomId, messageWithoutCommand); RocketChat.runSlashCommand(command, roomId, messageWithoutCommand);
} catch (e) { } catch (e) {
log('slashCommand', e); log(e);
} }
this.clearInput(); this.clearInput();
return; return;

View File

@ -10,7 +10,7 @@ export default function() {
const result = await this.sdk.get('commands.list'); const result = await this.sdk.get('commands.list');
if (!result.success) { if (!result.success) {
log('getSlashCommand fetch', result); console.log(result);
return resolve(); return resolve();
} }
@ -22,7 +22,7 @@ export default function() {
try { try {
database.create('slashCommand', command, true); database.create('slashCommand', command, true);
} catch (e) { } catch (e) {
log('get_slash_command', e); log(e);
} }
})); }));
return resolve(); return resolve();

View File

@ -100,30 +100,30 @@ export function sendFileMessage(rid, fileInfo, tmid, server, user) {
database.create('uploads', fileInfo, true); database.create('uploads', fileInfo, true);
const response = JSON.parse(xhr.response); const response = JSON.parse(xhr.response);
reject(response); reject(response);
} catch (err) { } catch (e) {
reject(err); reject(e);
log(err); log(e);
} }
}); });
} }
}; };
xhr.onerror = (e) => { xhr.onerror = (error) => {
database.write(() => { database.write(() => {
fileInfo.error = true; fileInfo.error = true;
try { try {
database.create('uploads', fileInfo, true); database.create('uploads', fileInfo, true);
reject(error);
} catch (e) {
reject(e); reject(e);
} catch (err) { log(e);
reject(err);
log(err);
} }
}); });
}; };
xhr.send(formData); xhr.send(formData);
} catch (err) { } catch (e) {
log(err); log(e);
} }
}); });
} }

View File

@ -4,7 +4,6 @@ import { View, Text } from 'react-native';
import FastImage from 'react-native-fast-image'; import FastImage from 'react-native-fast-image';
import { RectButton } from 'react-native-gesture-handler'; import { RectButton } from 'react-native-gesture-handler';
import log from '../../utils/log';
import Check from '../../containers/Check'; import Check from '../../containers/Check';
import styles, { ROW_HEIGHT } from './styles'; import styles, { ROW_HEIGHT } from './styles';
@ -24,7 +23,7 @@ const ServerItem = React.memo(({
}} }}
defaultSource={{ uri: 'logo' }} defaultSource={{ uri: 'logo' }}
style={styles.serverIcon} style={styles.serverIcon}
onError={() => log('err_loading_server_icon')} onError={() => console.log('err_loading_server_icon')}
/> />
) )
: ( : (

View File

@ -128,8 +128,8 @@ export default class NotificationPreferencesView extends React.Component {
}; };
try { try {
await RocketChat.saveNotificationSettings(this.rid, params); await RocketChat.saveNotificationSettings(this.rid, params);
} catch (err) { } catch (e) {
log('err_save_notification_settings', err); log(e);
} }
} }
@ -142,8 +142,8 @@ export default class NotificationPreferencesView extends React.Component {
}; };
try { try {
await RocketChat.saveNotificationSettings(this.rid, params); await RocketChat.saveNotificationSettings(this.rid, params);
} catch (err) { } catch (e) {
log('err_save_notification_settings', err); log(e);
} }
} }

View File

@ -98,8 +98,8 @@ class RoomInfoView extends React.Component {
room = result.room; room = result.room;
this.setState({ room }); this.setState({ room });
} }
} catch (error) { } catch (e) {
log('err_get_room_info', error); log(e);
} }
} }
const permissions = RocketChat.hasPermission([PERMISSION_EDIT_ROOM], room.rid); const permissions = RocketChat.hasPermission([PERMISSION_EDIT_ROOM], room.rid);