Skip to content

Commit

Permalink
fix: upgrade snapshot-sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
wa0x6e committed Aug 29, 2023
1 parent c765cd8 commit 673be74
Show file tree
Hide file tree
Showing 18 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"dependencies": {
"@snapshot-labs/keycard": "^0.2.0",
"@snapshot-labs/snapshot-metrics": "^1.0.0",
"@snapshot-labs/snapshot-sentry": "^1.1.0",
"@snapshot-labs/snapshot-sentry": "^1.3.0",
"@snapshot-labs/snapshot.js": "^0.5.4",
"bluebird": "^3.7.2",
"connection-string": "^1.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/graphql/operations/aliases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default async function (parent, args) {
return await db.queryAsync(query, params);
} catch (e: any) {
log.error(`[graphql] aliases, ${JSON.stringify(e)}`);
capture(e, { contexts: { input: { args } } });
capture(e, { args });
return Promise.reject('request failed');
}
}
2 changes: 1 addition & 1 deletion src/graphql/operations/follows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default async function (parent, args) {
return follows.map(follow => formatFollow(follow));
} catch (e: any) {
log.error(`[graphql] follows, ${JSON.stringify(e)}`);
capture(e, { contexts: { input: { args } } });
capture(e, { args });
return Promise.reject('request failed');
}
}
2 changes: 1 addition & 1 deletion src/graphql/operations/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default async function (parent, args) {
return await db.queryAsync(query, params);
} catch (e: any) {
log.error(`[graphql] messages, ${JSON.stringify(e)}`);
capture(e, { contexts: { input: { args } } });
capture(e, { args });
return Promise.reject('request failed');
}
}
2 changes: 1 addition & 1 deletion src/graphql/operations/proposal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default async function (parent, { id }) {
return proposals.map(proposal => formatProposal(proposal))[0] || null;
} catch (e: any) {
log.error(`[graphql] proposal, ${JSON.stringify(e)}`);
capture(e, { contexts: { input: { id } } });
capture(e, { id });
return Promise.reject('request failed');
}
}
2 changes: 1 addition & 1 deletion src/graphql/operations/proposals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export default async function (parent, args) {
return proposals.map(proposal => formatProposal(proposal));
} catch (e: any) {
log.error(`[graphql] proposals, ${JSON.stringify(e)}`);
capture(e, { contexts: { input: { args } } });
capture(e, { args });
return Promise.reject('request failed');
}
}
2 changes: 1 addition & 1 deletion src/graphql/operations/ranking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default async function (_parent, args, context, info) {
} catch (e: any) {
log.error(`[graphql] spaces, ${JSON.stringify(e)}`);
if (e instanceof PublicError) return e;
capture(e, { contexts: { input: { args, context, info } } });
capture(e, { args, context, info });
return new Error('Unexpected error');
}
}
2 changes: 1 addition & 1 deletion src/graphql/operations/space.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default async function (_parent, { id }, context, info) {
} catch (e: any) {
log.error(`[graphql] space, ${JSON.stringify(e)}`);
if (e instanceof PublicError) return e;
capture(e, { contexts: { input: { id, context, info } } });
capture(e, { id, context, info });
return new Error('Unexpected error');
}
}
2 changes: 1 addition & 1 deletion src/graphql/operations/spaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default async function (_parent, args, context, info) {
} catch (e: any) {
log.error(`[graphql] spaces, ${JSON.stringify(e)}`);
if (e instanceof PublicError) return e;
capture(e, { contexts: { input: { args, context, info } } });
capture(e, { args, context, info });
return new Error('Unexpected error');
}
}
2 changes: 1 addition & 1 deletion src/graphql/operations/statement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default async function (parent, args) {
return null;
} catch (e: any) {
log.error(`[graphql] statement, ${JSON.stringify(e)}`);
capture(e, { contexts: { input: { args } } });
capture(e, { args });
return Promise.reject('request failed');
}
}
2 changes: 1 addition & 1 deletion src/graphql/operations/statements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default async function (parent, args) {
return statements;
} catch (e: any) {
log.error(`[graphql] statements, ${JSON.stringify(e)}`);
capture(e, { contexts: { input: { args } } });
capture(e, { args });
return Promise.reject('request failed');
}
}
2 changes: 1 addition & 1 deletion src/graphql/operations/subscriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default async function (parent, args) {
return subscriptions.map(subscription => formatSubscription(subscription));
} catch (e: any) {
log.error(`[graphql] subscriptions, ${JSON.stringify(e)}`);
capture(e, { contexts: { input: { args } } });
capture(e, { args });
return Promise.reject('request failed');
}
}
2 changes: 1 addition & 1 deletion src/graphql/operations/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default async function (parent, args) {
return null;
} catch (e: any) {
log.error(`[graphql] user, ${JSON.stringify(e)}`);
capture(e, { contexts: { input: { args } } });
capture(e, { args });
return Promise.reject('request failed');
}
}
2 changes: 1 addition & 1 deletion src/graphql/operations/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default async function (parent, args) {
return users.map(user => formatUser(user));
} catch (e: any) {
log.error(`[graphql] users, ${JSON.stringify(e)}`);
capture(e, { contexts: { input: { args } } });
capture(e, { args });
return Promise.reject('request failed');
}
}
4 changes: 2 additions & 2 deletions src/graphql/operations/vote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ export default async function (parent, { id }, context, info) {
result.proposal = formatProposal(proposals[0]);
} catch (e: any) {
log.error(`[graphql] vote, ${JSON.stringify(e)}`);
capture(e, { contexts: { input: { id, context, info } } });
capture(e, { id, context, info });
return Promise.reject('request failed');
}
}
return result;
} catch (e: any) {
log.error(`[graphql] vote, ${JSON.stringify(e)}`);
capture(e, { contexts: { input: { id, context, info } } });
capture(e, { id, context, info });
return Promise.reject('request failed');
}
}
6 changes: 3 additions & 3 deletions src/graphql/operations/votes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async function query(parent, args, context?, info?) {
// TODO: we need settings in the vote as its being passed to formatSpace inside formatVote, Maybe we dont need to do this?
votes = votes.map(vote => formatVote(vote));
} catch (e: any) {
capture(e, { contexts: { input: { args, context, info } } });
capture(e, { args, context, info });
log.error(`[graphql] votes, ${JSON.stringify(e)}`);
return Promise.reject('request failed');
}
Expand All @@ -69,7 +69,7 @@ async function query(parent, args, context?, info?) {
return vote;
});
} catch (e: any) {
capture(e, { contexts: { input: { args, context, info } } });
capture(e, { args, context, info });
log.error(`[graphql] votes, ${JSON.stringify(e)}`);
return Promise.reject('request failed');
}
Expand All @@ -92,7 +92,7 @@ async function query(parent, args, context?, info?) {
return vote;
});
} catch (e: any) {
capture(e, { contexts: { input: { args, context, info } } });
capture(e, { args, context, info });
log.error(`[graphql] votes, ${JSON.stringify(e)}`);
return Promise.reject('request failed');
}
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/moderation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async function run() {
consecutiveFailsCount++;

if (consecutiveFailsCount >= 5) {
capture(e, { contexts: { input: { url: moderationURL } } });
capture(e, { url: moderationURL });
}
log.error(`[moderation] failed to load ${JSON.stringify(e)}`);
}
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1306,10 +1306,10 @@
express-prom-bundle "^6.6.0"
prom-client "^14.2.0"

"@snapshot-labs/snapshot-sentry@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@snapshot-labs/snapshot-sentry/-/snapshot-sentry-1.1.0.tgz#b357d4789ffd287f90fb70e7f0b207b47627cf24"
integrity sha512-Z31Y/5RJkTudrUwPasRxfABEQG2eQ2Ka5+vpi5zEwspt5gwTEfVM8M1NlYMFikWYqXHvVk51EU3UmJTqgL6pIg==
"@snapshot-labs/snapshot-sentry@^1.3.0":
version "1.3.0"
resolved "https://registry.yarnpkg.com/@snapshot-labs/snapshot-sentry/-/snapshot-sentry-1.3.0.tgz#9822d62b9a8918c70a09167da7b36ff43b9edba0"
integrity sha512-Qy+uLwsLhlRjx8MSbVU46tYVbiA5fIp6i1bgyab5pHwqsBaP93sjQIBetfGzeWxmmUXI8cS4lUOCc/x0HXEEGg==
dependencies:
"@sentry/node" "^7.60.1"

Expand Down

0 comments on commit 673be74

Please sign in to comment.