Skip to content

Commit

Permalink
handle 404 vs 500 error rendering
Browse files Browse the repository at this point in the history
Signed-off-by: Carina Ursu <carina@union.ai>
  • Loading branch information
ursucarina committed Jan 30, 2025
1 parent 8a32237 commit bb43675
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ export const ExecutionNodeDeck: React.FC<{
'allow-downloads',
].join(' ');

if (downloadLink?.lastError instanceof NotFoundError) {
/**
* if the download link query has an error other than 404, we show a 'pretty' message to the user.
* else: we show the built in DataError handler passed to the WaitForQuery component.
*/
if (downloadLink?.lastError && !(downloadLink?.lastError instanceof NotFoundError)) {
return (

Check warning on line 36 in packages/oss-console/src/components/Executions/ExecutionDetails/ExecutionNodeDeck.tsx

View check run for this annotation

Codecov / codecov/patch

packages/oss-console/src/components/Executions/ExecutionDetails/ExecutionNodeDeck.tsx#L35-L36

Added lines #L35 - L36 were not covered by tests
<div style={{ textAlign: 'center' }}>
<h1>The deck will be ready soon. Please try again later.</h1>
Expand All @@ -44,6 +48,7 @@ export const ExecutionNodeDeck: React.FC<{
);
}

// 404 or no error case
return (
<WaitForData {...downloadLink} loadingComponent={LoadingSpinner}>
<iframe
Expand Down

0 comments on commit bb43675

Please sign in to comment.