@@ -27,7 +27,7 @@ import {
|
||||
} from '@backstage/plugin-permission-common';
|
||||
import { getBearerTokenFromAuthorizationHeader } from '@backstage/plugin-auth-node';
|
||||
import { stringifyEntityRef } from '@backstage/catalog-model';
|
||||
import { stringifyError } from "@backstage/errors";
|
||||
import { stringifyError } from '@backstage/errors';
|
||||
|
||||
/** @public */
|
||||
export interface RouterOptions {
|
||||
@@ -92,7 +92,6 @@ export async function createRouter(
|
||||
backstageToken: token,
|
||||
});
|
||||
|
||||
|
||||
try {
|
||||
const projects = await jenkinsApi.getProjects(jenkinsInfo, branches);
|
||||
|
||||
@@ -103,9 +102,13 @@ export async function createRouter(
|
||||
// Promise.any, used in the getProjects call returns an Aggregate error message with a useless error message 'AggregateError: All promises were rejected'
|
||||
// extract useful information ourselves
|
||||
if (err.errors) {
|
||||
throw new Error(`Unable to fetch projects, for ${jenkinsInfo.jobFullName}: ${stringifyError(err.errors)}`)
|
||||
throw new Error(
|
||||
`Unable to fetch projects, for ${
|
||||
jenkinsInfo.jobFullName
|
||||
}: ${stringifyError(err.errors)}`,
|
||||
);
|
||||
}
|
||||
throw err
|
||||
throw err;
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user