Skip to content

Commit

Permalink
Use instanceof instead of === for error check
Browse files Browse the repository at this point in the history
  • Loading branch information
WishingWell13 committed Apr 13, 2024
1 parent c745347 commit 266390e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const AdminPickupEventForm = ({ mode, defaultData = {}, token, upcomingEvents }:
]);
router.push(`${config.admin.store.pickup}/${uuid}`);
} catch (error) {
if (error === RangeError) {
if (error instanceof RangeError) {
reportError('Invalid date, could not create pickup event', error);
} else {
reportError('Could not create pickup event', error);
Expand Down Expand Up @@ -164,7 +164,7 @@ const AdminPickupEventForm = ({ mode, defaultData = {}, token, upcomingEvents }:
},
});
} catch (error) {
if (error === RangeError) {
if (error instanceof RangeError) {
reportError("Invalid date, can't save changes", error);
} else {
reportError('Could not save changes', error);
Expand Down

0 comments on commit 266390e

Please sign in to comment.