Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log err if not 404 #152

Merged
merged 2 commits into from
May 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import axios, { isAxiosError } from 'axios';
import type { GetStaticProps, NextPage } from 'next';
import { useState } from 'react';

import { IHome } from '../data/types/home';
import { getStaticAsset } from './api/static/[asset]';

import Carousel from '@this/components/Elements/Carousel';
import {
AlumSpotlight,
GreatCompanies,
Expand All @@ -13,15 +15,12 @@ import {
TopCard,
} from '@this/components/Home';
import Main from '@this/components/layout/Main';

import Carousel from '@this/components/Elements/Carousel';
import { Showcase } from '@this/data/types/gradShowcase';
import { ILogo } from '@this/data/types/logos';
import AtlantaPromo from '@this/src/components/Elements/AtlantaPromo';
import PromoVideo from '@this/src/components/Home/PromoVideo';
import ShowcasePromo from '@this/src/components/Home/ShowcasePromo';
import { toDayJs } from '@this/src/helpers/time';
import axios from 'axios';

// const gCloudBaseUrl = 'https://storage.googleapis.com/operationspark-org';

Expand Down Expand Up @@ -77,8 +76,12 @@ const getShowcase = async () => {
}

return data;
} catch {
console.info('Showcase inactive');
} catch (err) {
if (isAxiosError(err) && err.response?.status === 404) {
console.info('Showcase inactive');
return null;
}
console.error('Showcase fetch error: ', err);
return null;
}
};
Expand Down
Loading