Skip to content

Commit

Permalink
Merge pull request #152 from OperationSpark/log-error-if-not-404
Browse files Browse the repository at this point in the history
log err if not 404
  • Loading branch information
ptbarnum4 committed May 1, 2024
2 parents 87f3f6a + 030f6b7 commit 3a810e3
Showing 1 changed file with 8 additions and 5 deletions.
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

0 comments on commit 3a810e3

Please sign in to comment.