Merge pull request #14358 from RoadieHQ/better-error-handling
add more specific error handling for github actions
This commit is contained in:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user