Skip to content

Commit

Permalink
Fix display of create enclave error
Browse files Browse the repository at this point in the history
  • Loading branch information
Dartoxian committed Nov 16, 2023
1 parent 6bf65d2 commit bf89644
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions enclave-manager/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.1.0",
"private": true,
"homepage": ".",
"proxy": "http://localhost:8081",
"dependencies": {
"@chakra-ui/icons": "^2.1.1",
"@chakra-ui/react": "^2.8.1",
Expand Down
6 changes: 4 additions & 2 deletions enclave-manager/web/src/components/KurtosisAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type KurtosisAlertProps = AlertProps & {

export const KurtosisAlert = ({ message, details, ...alertProps }: KurtosisAlertProps) => {
return (
<Alert status="error" {...alertProps}>
<Alert status="error" overflowY={"auto"} maxHeight={"300px"} alignItems={"flex-start"} {...alertProps}>
<AlertIcon />
<Flex flexDirection={"column"} width={"100%"} gap={"8px"}>
<Flex direction={"row"}>
Expand All @@ -40,7 +40,9 @@ export const KurtosisAlert = ({ message, details, ...alertProps }: KurtosisAlert
</AccordionButton>
</h2>
<AccordionPanel pb={4}>
<Box as={"pre"}>{details}</Box>
<Box as={"pre"} whiteSpace={"pre-wrap"} wordBreak={"break-word"}>
{details}
</Box>
</AccordionPanel>
</AccordionItem>
</Accordion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import {
ModalHeader,
ModalOverlay,
Text,
Tooltip, useToast,
Tooltip,
useToast,
} from "@chakra-ui/react";
import { EnclaveMode } from "enclave-manager-sdk/build/engine_service_pb";
import { useMemo, useRef, useState } from "react";
Expand Down Expand Up @@ -152,6 +153,7 @@ export const ConfigureEnclaveModal = ({
const handleClose = () => {
if (!isLoading) {
navigator("#", { replace: true });
setError(undefined);
onClose();
}
};
Expand All @@ -167,7 +169,9 @@ export const ConfigureEnclaveModal = ({
}
} catch (err) {
toast({
title: `An error occurred while preparing data for running package. The package arguments were not proper JSON: ${stringifyError(err)}`,
title: `An error occurred while preparing data for running package. The package arguments were not proper JSON: ${stringifyError(
err,
)}`,
colorScheme: "red",
});
return;
Expand Down Expand Up @@ -251,7 +255,7 @@ export const ConfigureEnclaveModal = ({
<EnclaveSourceButton source={kurtosisPackage.name} size={"sm"} variant={"outline"} color={"gray.100"} />
</Flex>
{isDefined(error) && (
<KurtosisAlert flex={"0"} message={"Could not execute configuration"} details={error} />
<KurtosisAlert flex={"1 0 auto"} message={"Could not execute configuration"} details={error} />
)}
<Flex
flex={"0 1 auto"}
Expand Down

0 comments on commit bf89644

Please sign in to comment.