feat: improved err messaging for netlify

This commit is contained in:
Alicia Sykes 2024-06-16 21:04:36 +01:00
parent 316e0d97fd
commit 7d4eab28b4
2 changed files with 5 additions and 1 deletions

View File

@ -22,7 +22,7 @@ const Nav = (props: { children?: ReactNode}) => {
<Header as="header"> <Header as="header">
<Heading color={colors.primary} size="large"> <Heading color={colors.primary} size="large">
<img width="64" src="/web-check.png" alt="Web Check Icon" /> <img width="64" src="/web-check.png" alt="Web Check Icon" />
<Link to="/check">Web Check</Link> <Link to="/">Web Check</Link>
</Heading> </Heading>
{props.children && props.children} {props.children && props.children}
</Header> </Header>

View File

@ -47,6 +47,10 @@ const useMotherOfAllHooks = <ResultType = any>(params: UseIpAddressProps<ResultT
} else { } else {
updateLoadingJobs(jobId, 'error', res.error, reset); updateLoadingJobs(jobId, 'error', res.error, reset);
} }
} else if (res.errorType && res.errorMessage) {
const errorMessage = `${res.errorType}\n${res.errorMessage}\n\n`
+ `This sometimes occurs on Netlify if using the free plan. You may need to upgrade to use lambda functions`;
updateLoadingJobs(jobId, 'error', errorMessage, reset);
} else if (res.skipped) { // Response returned a skipped message } else if (res.skipped) { // Response returned a skipped message
updateLoadingJobs(jobId, 'skipped', res.skipped, reset); updateLoadingJobs(jobId, 'skipped', res.skipped, reset);
} else { // Yay, everything went to plan :) } else { // Yay, everything went to plan :)