Skip to content

Commit

Permalink
general subnet errors?
Browse files Browse the repository at this point in the history
  • Loading branch information
coliu-akamai committed Dec 9, 2024
1 parent 2291f7f commit bc20b43
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,10 @@ export const SubnetContent = (props: Props) => {
</Link>
.
</StyledBodyTypography>
{/* TODO: figure out general subnet errors */}
{errors.subnets?.root?.message && (
{errors.subnets?.message && (
<Notice
spacingBottom={8}
text={errors.subnets.root.message}
text={errors.subnets.message}
variant="error"
/>
)}
Expand Down
5 changes: 4 additions & 1 deletion packages/manager/src/hooks/useCreateVPC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ export const useCreateVPC = (inputs: UseCreateVPCInputs) => {
}
} catch (errors) {
for (const error of errors) {
if (error?.field === 'subnets.label') {
if (
error?.field === 'subnets.label' ||
error?.field === 'subnets.ipv4'
) {
form.setError('subnets', { message: error.reason });
} else {
form.setError(error?.field ?? 'root', { message: error.reason });
Expand Down

0 comments on commit bc20b43

Please sign in to comment.