Skip to content

Commit

Permalink
Show error message when failed to load schema or custom fields
Browse files Browse the repository at this point in the history
  • Loading branch information
jakeprins committed Oct 2, 2023
1 parent e177f02 commit 3fca396
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/FieldMappingForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ const FieldMappingForm = ({
</div>
</p>
</div>
<div className="flex items-center justify-center py-2">
<div className="flex items-center justify-center py-2.5">
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
Expand Down
15 changes: 12 additions & 3 deletions src/utils/useConnections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,13 @@ export const ConnectionsProvider = ({
);

return await raw.json();
} catch (error) {
} catch (error: any) {
console.error(error);
addToast({
title: 'Failed to fetch schema',
description: error?.message,
type: 'error',
});
}
};

Expand All @@ -361,9 +366,13 @@ export const ConnectionsProvider = ({
);

return await raw.json();
} catch (error) {
} catch (error: any) {
console.error(error);
return;
addToast({
title: 'Failed to fetch custom fields',
description: error?.message,
type: 'error',
});
}
};

Expand Down

0 comments on commit 3fca396

Please sign in to comment.