Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore:(deps): bump typescript from 4.3.5 to 4.4.2 in /explorer #19463

Merged
merged 2 commits into from
Sep 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions explorer/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"react-scripts": "^4.0.3",
"react-select": "^4.3.1",
"superstruct": "^0.15.2",
"typescript": "^4.3.5"
"typescript": "^4.4.2"
},
"scripts": {
"start": "react-scripts start",
Expand Down
2 changes: 1 addition & 1 deletion explorer/src/pages/inspector/RawInputCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export function RawInput({
setError(undefined);
return;
} catch (err) {
setError(err.message);
if (err instanceof Error) setError(err.message);
}
} else {
setError(undefined);
Expand Down
4 changes: 3 additions & 1 deletion explorer/src/pages/inspector/SimulatorCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,9 @@ function useSimulator(message: Message) {
} catch (err) {
console.error(err);
setLogs(null);
setError(err.message);
if (err instanceof Error) {
setError(err.message);
}
} finally {
setSimulating(false);
}
Expand Down
38 changes: 22 additions & 16 deletions explorer/src/providers/stats/solanaClusterStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,16 @@ export function SolanaClusterStatsProvider({ children }: Props) {
if (cluster !== Cluster.Custom) {
reportError(error, { url });
}
dispatchPerformanceInfo({
type: PerformanceInfoActionType.SetError,
data: error.toString(),
});
dispatchDashboardInfo({
type: DashboardInfoActionType.SetError,
data: error.toString(),
});
if (error instanceof Error) {
dispatchPerformanceInfo({
type: PerformanceInfoActionType.SetError,
data: error.toString(),
});
dispatchDashboardInfo({
type: DashboardInfoActionType.SetError,
data: error.toString(),
});
}
setActive(false);
}
};
Expand All @@ -149,10 +151,12 @@ export function SolanaClusterStatsProvider({ children }: Props) {
if (cluster !== Cluster.Custom) {
reportError(error, { url });
}
dispatchPerformanceInfo({
type: PerformanceInfoActionType.SetError,
data: error.toString(),
});
if (error instanceof Error) {
dispatchPerformanceInfo({
type: PerformanceInfoActionType.SetError,
data: error.toString(),
});
}
setActive(false);
}
};
Expand All @@ -169,10 +173,12 @@ export function SolanaClusterStatsProvider({ children }: Props) {
if (cluster !== Cluster.Custom) {
reportError(error, { url });
}
dispatchDashboardInfo({
type: DashboardInfoActionType.SetError,
data: error.toString(),
});
if (error instanceof Error) {
dispatchDashboardInfo({
type: DashboardInfoActionType.SetError,
data: error.toString(),
});
}
setActive(false);
}
};
Expand Down
18 changes: 10 additions & 8 deletions explorer/src/utils/sentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ type Tags =
}
| undefined;

export function reportError(err: Error, tags: Tags) {
console.error(err, err.message);
try {
Sentry.captureException(err, {
tags,
});
} catch (err) {
// Sentry can fail if error rate limit is reached
export function reportError(err: unknown, tags: Tags) {
if (err instanceof Error) {
console.error(err, err.message);
try {
Sentry.captureException(err, {
tags,
});
} catch (err) {
// Sentry can fail if error rate limit is reached
}
}
}