feature: remove instanceof check from CITable, add @backstage/errors to jenkins plugin to resolve eslint related issues

Signed-off-by: Hasan Ozdemir <21654050+nodify-at@users.noreply.github.com>
This commit is contained in:
Hasan Ozdemir
2021-12-18 19:10:15 +01:00
parent 047d92db5e
commit d03ee9e28f
3 changed files with 5 additions and 9 deletions
-1
View File
@@ -20,7 +20,6 @@ import {
IdentityApi,
} from '@backstage/core-plugin-api';
import type { EntityName, EntityRef } from '@backstage/catalog-model';
// eslint-disable-next-line import/no-extraneous-dependencies
import { ResponseError } from '@backstage/errors';
export const jenkinsApiRef = createApiRef<JenkinsApi>({
@@ -24,8 +24,6 @@ import { buildRouteRef } from '../../../../plugin';
import { Progress, Table, TableColumn } from '@backstage/core-components';
import { Project } from '../../../../api/JenkinsApi';
import { alertApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api';
// eslint-disable-next-line import/no-extraneous-dependencies
import { ResponseError } from '@backstage/errors';
const FailCount = ({ count }: { count: number }): JSX.Element | null => {
if (count !== 0) {
@@ -190,12 +188,10 @@ const generatedColumns: TableColumn[] = [
severity: 'success',
});
} catch (e) {
if (e instanceof ResponseError) {
alertApi.post({
message: `Jenkins re-build has failed. Error: ${e.message}`,
severity: 'error',
});
}
alertApi.post({
message: `Jenkins re-build has failed. Error: ${e.message}`,
severity: 'error',
});
} finally {
setIsLoadingRebuild(false);
}