mirror of
https://codeberg.org/alicia/web-check.git
synced 2024-06-03 00:52:13 +02:00
Logging for timeout info, and adds key to map
This commit is contained in:
parent
c764bbfcd4
commit
7a8e694abc
|
@ -208,12 +208,24 @@ const Results = (): JSX.Element => {
|
||||||
console.log(
|
console.log(
|
||||||
`%cFetch Error - ${job}%c\n\n${timeString}%c The ${job} job failed `
|
`%cFetch Error - ${job}%c\n\n${timeString}%c The ${job} job failed `
|
||||||
+`after ${timeTaken}ms, with the following error:%c\n${error}`,
|
+`after ${timeTaken}ms, with the following error:%c\n${error}`,
|
||||||
`background: ${colors.danger}; padding: 4px 8px; font-size: 16px;`,
|
`background: ${colors.danger}; color:${colors.background}; padding: 4px 8px; font-size: 16px;`,
|
||||||
`font-weight: bold; color: ${colors.danger};`,
|
`font-weight: bold; color: ${colors.danger};`,
|
||||||
`color: ${colors.danger};`,
|
`color: ${colors.danger};`,
|
||||||
`color: ${colors.warning};`,
|
`color: ${colors.warning};`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (newState === 'timed-out') {
|
||||||
|
console.log(
|
||||||
|
`%cFetch Timeout - ${job}%c\n\n${timeString}%c The ${job} job timed out `
|
||||||
|
+`after ${timeTaken}ms, with the following error:%c\n${error}`,
|
||||||
|
`background: ${colors.info}; color:${colors.background}; padding: 4px 8px; font-size: 16px;`,
|
||||||
|
`font-weight: bold; color: ${colors.info};`,
|
||||||
|
`color: ${colors.info};`,
|
||||||
|
`color: ${colors.warning};`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return newJobs;
|
return newJobs;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -225,8 +237,9 @@ const Results = (): JSX.Element => {
|
||||||
.then(data => resolve(data))
|
.then(data => resolve(data))
|
||||||
.catch(error => resolve(
|
.catch(error => resolve(
|
||||||
{ error: `Failed to get a valid response 😢\n`
|
{ error: `Failed to get a valid response 😢\n`
|
||||||
+ `This is likely due the target not exposing the required data, `
|
+ 'This is likely due the target not exposing the required data, '
|
||||||
+ `or limitations in how Netlify executes lambda functions, such as the 10-sec timeout.\n\n`
|
+ 'or limitations in imposed by the infrastructure this instance '
|
||||||
|
+ 'of Web Check is running on.\n\n'
|
||||||
+ `Error info:\n${error}`}
|
+ `Error info:\n${error}`}
|
||||||
));
|
));
|
||||||
});
|
});
|
||||||
|
@ -910,7 +923,7 @@ const Results = (): JSX.Element => {
|
||||||
&& title.toLowerCase().includes(searchTerm.toLowerCase())
|
&& title.toLowerCase().includes(searchTerm.toLowerCase())
|
||||||
&& (result && !result.error);
|
&& (result && !result.error);
|
||||||
return show ? (
|
return show ? (
|
||||||
<ErrorBoundary title={title}>
|
<ErrorBoundary title={title} key={`eb-${index}`}>
|
||||||
<Component
|
<Component
|
||||||
key={`${title}-${index}`}
|
key={`${title}-${index}`}
|
||||||
data={{...result}}
|
data={{...result}}
|
||||||
|
|
Loading…
Reference in a new issue