chore: refactor the test

Signed-off-by: benjdlambert <ben@blam.sh>
This commit is contained in:
benjdlambert
2025-05-27 15:12:16 +02:00
parent c999c2568b
commit 0a9deff5cb
@@ -53,22 +53,24 @@ export class DefaultActionsService implements ActionsService {
const remoteActionsList = await Promise.all(
pluginSources.map(async source => {
const response = await this.makeRequest({
path: `/.backstage/actions/v1/actions`,
pluginId: source,
credentials,
});
try {
const response = await this.makeRequest({
path: `/.backstage/actions/v1/actions`,
pluginId: source,
credentials,
});
if (!response.ok) {
throw await ResponseError.fromResponse(response);
}
const { actions } = (await response.json()) as {
actions: ActionsServiceAction;
};
if (!response.ok) {
this.logger.warn(`Failed to fetch actions from ${source}`);
return actions;
} catch (error) {
this.logger.warn(`Failed to fetch actions from ${source}`, error);
return [];
}
const { actions } = (await response.json()) as {
actions: ActionsServiceAction;
};
return actions;
}),
);