Skip to content

Commit

Permalink
Fixing error message
Browse files Browse the repository at this point in the history
Signed-off-by: saimedhi <[email protected]>
  • Loading branch information
saimedhi committed Nov 5, 2024
1 parent 08b6307 commit b616dac
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions public/pages/workflows/workflow_list/resource_list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function ResourceList(props: ResourceListProps) {
</EuiText>
</EuiFlexItem>
<EuiFlexItem grow={true} style={{ paddingLeft: '20px' }}>
{!isEmpty(data) && !loading ? (
{!data.startsWith('error:') && !loading ? (
<EuiCodeBlock
language="json"
fontSize="m"
Expand All @@ -89,12 +89,7 @@ export function ResourceList(props: ResourceListProps) {
iconType="alert"
iconColor="danger"
title={<h2>Error loading resource details</h2>}
body={
<p>
You do not have permissions to access details of this
resource.
</p>
}
body={<p>{data.replace(/^error:\s*/, '')}</p>}
/>
)}
</EuiFlexItem>
Expand Down Expand Up @@ -122,7 +117,7 @@ export function ResourceList(props: ResourceListProps) {
} catch (error) {
setItemIdToExpandedRowMap((prevMap) => ({
...prevMap,
[item.id]: renderExpandedRow(''),
[item.id]: renderExpandedRow('error:' + error),
}));
}
}
Expand Down

0 comments on commit b616dac

Please sign in to comment.