How to use the sentry-expo.captureMessage function in sentry-expo

To help you get started, we’ve selected a few sentry-expo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github expo / harvard-cs50-app / utils / DownloadManager.js View on Github external
async _startDownloadForId(id) {
    const data = this._getDataWithId(id);
    const videoUri = data.videos['240p'];
    const fileUri = FileSystem.documentDirectory + id + '.mp4';

    // TODO: Catch errors
    try {
      const { exists } = await FileSystem.getInfoAsync(fileUri);
      if (exists) {
        await FileSystem.deleteAsync(fileUri);
      }
    } catch (e) {
      console.log('File overwrite error', e);
      Sentry.captureException(e);
      Sentry.captureMessage('File overwrite error');
      this._updateStore(id, ERROR({ message: 'Error downloading file' }));
      return;
    }

    try {
      const downloadResumable = FileSystem.createDownloadResumable(
        videoUri,
        fileUri,
        {},
        _.throttle(this._createDownloadProgressHandler(id), 200)
      );
      this._downloadResumables[id] = downloadResumable;
      const uri = await downloadResumable.downloadAsync();
      if (uri) {
        this._updateStore(id, DOWNLOADED({ uri }));
      }
github wheatandcat / Peperomia / PeperomiaNative / src / containers / Auth.tsx View on Github external
.catch(error => {
          Sentry.captureMessage(JSON.stringify(error));
        });
      console.log(data);
github expo / harvard-cs50-app / utils / DownloadManager.js View on Github external
try {
        const downloadResumable = new FileSystem.DownloadResumable(
          downloadFromStore.url,
          downloadFromStore.fileUri,
          downloadFromStore.options,
          this._createDownloadProgressHandler(id),
          downloadFromStore.resumeData
        );
        this._downloadResumables[id] = downloadResumable;
        const uri = await downloadResumable.resumeAsync();
        if (uri) {
          this._updateStore(id, DOWNLOADED({ uri }));
        }
      } catch (e) {
        console.log('File download error', e);
        Sentry.captureMessage('File download error');
        Sentry.captureException(e);
        this._updateStore(id, ERROR({ message: 'Error downloading file' }));
      } finally {
        delete this._downloadResumables[id];
      }
    }
  }
github expo / harvard-cs50-app / utils / DownloadManager.js View on Github external
try {
      const downloadResumable = FileSystem.createDownloadResumable(
        videoUri,
        fileUri,
        {},
        _.throttle(this._createDownloadProgressHandler(id), 200)
      );
      this._downloadResumables[id] = downloadResumable;
      const uri = await downloadResumable.downloadAsync();
      if (uri) {
        this._updateStore(id, DOWNLOADED({ uri }));
      }
    } catch (e) {
      console.log('File download error', e);
      Sentry.captureMessage('File download error');
      Sentry.captureException(e);
      this._updateStore(id, ERROR({ message: 'Error downloading file' }));
    } finally {
      delete this._downloadResumables[id];
    }
  }
github wheatandcat / Peperomia / PeperomiaNative / src / lib / backup.ts View on Github external
return new Promise(function(
    resolve: () => void,
    reject: (error: Error) => void
  ) {
    try {
      Promise.all([
        importItems(tx, items),
        importItemDetails(tx, itemDetail),
        importCalendars(tx, calendars),
      ]).then(function() {
        resolve();
      });
    } catch (err) {
      Sentry.captureMessage(err);
      reject(err);
    }
  });
};
github wheatandcat / Peperomia / PeperomiaNative / src / lib / migration.ts View on Github external
export const migrationV104 = async (): Promise => {
  try {
    await db.transaction(async (tx: SQLite.Transaction) => {
      await v1040(tx);
      await v1041(tx);
    });

    return true;
  } catch (err) {
    Sentry.captureMessage(err);
    return false;
  }
};
github wheatandcat / Peperomia / PeperomiaNative / src / lib / backup.ts View on Github external
bulkInsertItemDetail(tx, itemDetail, (data: ItemDetail[], err: any) => {
      if (err) {
        Sentry.captureMessage(err);
        reject(err);
        return;
      }

      resolve(data);
      return;
    });
  });

sentry-expo

Catch your Javascript errors for your production Expo apps!

MIT
Latest version published 10 months ago

Package Health Score

64 / 100
Full package analysis