Skip to content
This repository has been archived by the owner on Aug 6, 2024. It is now read-only.

Commit

Permalink
chore: add sentry logging for all endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
dalsontws committed Jun 6, 2024
1 parent d92ba04 commit eaab20f
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/services/campaignConfig/campaignConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ const liveGetCampaignConfig = async (
}
);
} catch (e) {
Sentry.captureMessage("ERROR_WHEN_GETTING_CAMPAIGN_CONFIG", {
level: "error",
extra: {
token,
endpoint,
error: e,
},
});
if (e instanceof ValidationError) {
Sentry.captureException(e);
} else if (e instanceof SessionError) {
Expand Down
24 changes: 24 additions & 0 deletions src/services/quota/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,14 @@ export const liveGetQuota = async (
});
return response;
} catch (e) {
Sentry.captureMessage("ERROR_WHEN_GETTING_QUOTA", {
level: "error",
extra: {
key,
endpoint,
error: e,
},
});
if (e instanceof NetworkError) {
throw e;
} else if (e instanceof ValidationError) {
Expand Down Expand Up @@ -320,6 +328,14 @@ export const livePostTransaction = async ({
);
return response;
} catch (e) {
Sentry.captureMessage("ERROR_WHEN_CREATING_TRANSACTIONS", {
level: "error",
extra: {
key,
endpoint,
error: e,
},
});
if (e instanceof NetworkError) {
throw e;
} else if (e instanceof ValidationError) {
Expand Down Expand Up @@ -424,6 +440,14 @@ export const livePastTransactions = async (
);
return response;
} catch (e) {
Sentry.captureMessage("ERROR_WHEN_GETTING_TRANSACTIONS_HISTORY", {
level: "error",
extra: {
key,
endpoint,
error: e,
},
});
if (e instanceof NetworkError) {
throw e;
} else if (e instanceof ValidationError) {
Expand Down
8 changes: 8 additions & 0 deletions src/services/statistics/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,14 @@ export const liveGetStatistics = async (
}
);
} catch (e) {
Sentry.captureMessage("ERROR_WHEN_GETTING_STATISTICS", {
level: "error",
extra: {
key,
endpoint,
error: e,
},
});
if (e instanceof NetworkError) {
throw e;
} else if (e instanceof ValidationError) {
Expand Down

0 comments on commit eaab20f

Please sign in to comment.