Skip to content

Commit

Permalink
fix: more user-friendly error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
stdavis committed Nov 29, 2024
1 parent 97144ab commit 22d043d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/components/filters/Purpose.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ export default function Purpose(): JSX.Element {
}, [selectedValues, filterDispatch]);

if (error) {
return <p>{error.message}</p>;
return (
<div className="text-sm text-rose-600 forced-colors:text-[Mark]">
There was an error retrieving the purpose values
</div>
);
}

return (
Expand Down
6 changes: 5 additions & 1 deletion src/components/filters/SpeciesLength.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ function RowControls({ species, min, max, onChange, addRow, removeRow, isLast }:
const { data, isPending, error } = useDomainValues(config.urls.fish, config.fieldNames.SPECIES_CODE);

if (error) {
return <p>{error.message}</p>;
return (
<div className="text-sm text-rose-600 forced-colors:text-[Mark]">
There was an error retrieving the species values
</div>
);
}

return (
Expand Down

0 comments on commit 22d043d

Please sign in to comment.