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:
@@ -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 {}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user