Merge pull request #14358 from RoadieHQ/better-error-handling

add more specific error handling for github actions
This commit is contained in:
Patrik Oldsberg
2022-11-03 12:01:53 +01:00
committed by GitHub
3 changed files with 14 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-github-actions': patch
---
Add error panel when the plugin fails.
@@ -29,6 +29,7 @@ import {
useRouteRef,
} from '@backstage/core-plugin-api';
import {
ErrorPanel,
InfoCard,
InfoCardVariants,
Link,
@@ -76,6 +77,11 @@ export const RecentWorkflowRunsCard = (props: {
const githubHost = hostname || 'github.com';
const routeLink = useRouteRef(buildRouteRef);
if (error) {
return <ErrorPanel title={error.message} error={error} />;
}
return (
<InfoCard
title="Recent Workflow Runs"
@@ -87,7 +87,9 @@ export function useWorkflowRuns({
runId: run.id,
});
} catch (e) {
errorApi.post(e);
errorApi.post(
new Error(`Failed to rerun the workflow: ${e.message}`),
);
}
},
source: {