Add error logs

This commit is contained in:
Jérémy Munsch 2023-09-05 09:27:14 +02:00
parent 9527502024
commit e3ee53bcd5
No known key found for this signature in database
GPG key ID: 18361AF3BFEC0FEC
3 changed files with 6 additions and 2 deletions

View file

@ -164,6 +164,7 @@ class InstallScreen extends React.Component {
})
.catch(function (error) {
Sentry.captureException(error);
console.error(error);
Alert.alert(i18n.t('alert.error'), i18n.t('error.error_has_occurred'));
return false;
});

View file

@ -7,6 +7,7 @@ import { initDirectories } from '../Store/Actions/directories';
import { initDocuments } from '../Store/Actions/documents';
// Sentry
import * as Sentry from '@sentry/react-native';
// Style
import styles from '../../Resources/Styles/SyncStyle';
// Translations
@ -418,6 +419,7 @@ class SyncScreen extends React.Component {
') ...',
});
try {
const uri = `${endpoint}${doc.uuid}.${doc.type}`;
await this.downloadResumable(
endpoint + doc.uuid + '.' + doc.type,
doc.uuid,
@ -427,7 +429,7 @@ class SyncScreen extends React.Component {
FileSystem.documentDirectory + doc.uuid + '.' + doc.type,
);
SyncController.updateLastModificationDoc(doc.id, modificationTime);
//console.log('Finished downloading to ', uri);
console.debug('Finished downloading to ', uri);
this.setState({ progress: this.state.progress + progress });
if (i < documents.length - 1) {
return this.download(documents, progress, i + 1);
@ -464,7 +466,7 @@ class SyncScreen extends React.Component {
[
{
text: i18n.t('global.cancel'),
onPress: () => console.log('Cancel Pressed'),
onPress: () => console.debug('Cancel Pressed'),
style: 'cancel',
},
{

View file

@ -63,6 +63,7 @@ class VideoScreen extends React.Component {
}}
errorCallback={e => {
console.error(e);
Sentry.captureException(e);
}}
/>
</View>