Skip to content

Commit

Permalink
accept valid 404 use case (#4276)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmrabian committed Oct 7, 2022
1 parent f5ddeaa commit 34a414c
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ export const AdminBannerProvider = ({ children }: Props) => {
const newBannerData = currentBanner?.Item || {};
setBannerData(newBannerData);
} catch (e: any) {
setError(bannerErrors.GET_BANNER_FAILED);
// 404 expected when no current banner exists
if (!e.toString().includes("404")) {
setError(bannerErrors.GET_BANNER_FAILED);
}
}
};

Expand Down

0 comments on commit 34a414c

Please sign in to comment.