fix(cicd-statistics): Don't instanceof, do fuzzy matching for better compat

Signed-off-by: Gustaf Räntilä <g.rantila@gmail.com>
This commit is contained in:
Gustaf Räntilä
2022-01-14 16:28:28 +01:00
committed by blam
parent 6c47447256
commit d3d16a2442
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -163,7 +163,7 @@ export interface CicdConfiguration {
/**
* If the Api implements support for aborting the fetching of builds, throw an
* AbortError of this type
* AbortError of this type (or any other error with name === 'AbortError').
*/
export class AbortError extends Error {}
+2 -2
View File
@@ -35,7 +35,7 @@ import {
getDefaultViewOptions,
ViewOptions,
} from './components/chart-filters';
import { AbortError, CicdConfiguration } from './apis';
import { CicdConfiguration } from './apis';
import { cleanupBuildTree } from './utils/stage-names';
import { renderFallbacks, useAsyncChain } from './components/progress';
@@ -131,7 +131,7 @@ function CicdCharts(props: CicdChartsProps) {
useEffect(() => {
if (
!chartableStagesState.error ||
chartableStagesState.error instanceof AbortError
chartableStagesState.error?.name === 'AbortError'
) {
return;
}