mirror of
https://github.com/labring/FastGPT.git
synced 2025-12-27 13:52:49 +00:00
16 lines
401 B
TypeScript
16 lines
401 B
TypeScript
function Error({ statusCode }: { statusCode: number }) {
|
|
return (
|
|
<p>
|
|
{statusCode ? `An error ${statusCode} occurred on server` : 'An error occurred on client'}
|
|
</p>
|
|
);
|
|
}
|
|
|
|
Error.getInitialProps = ({ res, err }: { res: any; err: any }) => {
|
|
const statusCode = res ? res.statusCode : err ? err.statusCode : 404;
|
|
console.log(err);
|
|
return { statusCode };
|
|
};
|
|
|
|
export default Error;
|