chore: Bugsnag -> Sentry (#1178)

* Bugsnag -> Sentry

* fix: Import style
This commit is contained in:
Tom Moor
2020-02-16 22:58:50 -08:00
committed by GitHub
parent 8fbd4a7463
commit c15cbd06a4
15 changed files with 157 additions and 238 deletions

View File

@ -5,7 +5,7 @@ import format from 'date-fns/format';
import AWS from 'aws-sdk';
import invariant from 'invariant';
import fetch from 'isomorphic-fetch';
import bugsnag from 'bugsnag';
import * as Sentry from '@sentry/node';
const AWS_SECRET_ACCESS_KEY = process.env.AWS_SECRET_ACCESS_KEY;
const AWS_ACCESS_KEY_ID = process.env.AWS_ACCESS_KEY_ID;
@ -116,7 +116,7 @@ export const uploadToS3FromUrl = async (
return `${endpoint}/${key}`;
} catch (err) {
if (process.env.NODE_ENV === 'production') {
bugsnag.notify(err);
Sentry.captureException(err);
} else {
throw err;
}
@ -149,7 +149,7 @@ export const getImageByKey = async (key: string) => {
return data.Body;
} catch (err) {
if (process.env.NODE_ENV === 'production') {
bugsnag.notify(err);
Sentry.captureException(err);
} else {
throw err;
}

View File

@ -2,10 +2,10 @@
import fs from 'fs';
import JSZip from 'jszip';
import tmp from 'tmp';
import * as Sentry from '@sentry/node';
import unescape from '../../shared/utils/unescape';
import { Attachment, Collection, Document } from '../models';
import { getImageByKey } from './s3';
import bugsnag from 'bugsnag';
async function addToArchive(zip, documents) {
for (const doc of documents) {
@ -36,7 +36,7 @@ async function addImageToArchive(zip, key) {
zip.file(key, img, { createFolders: true });
} catch (err) {
if (process.env.NODE_ENV === 'production') {
bugsnag.notify(err);
Sentry.captureException(err);
} else {
// error during file retrieval
console.error(err);