✨ frontend add
This commit is contained in:
19
frontend/admin/src/pages/_error/index.tsx
Normal file
19
frontend/admin/src/pages/_error/index.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import React from 'react'
|
||||
import { NextPageContext } from 'next'
|
||||
|
||||
const Error = ({ statusCode }) => {
|
||||
return (
|
||||
<p>
|
||||
{statusCode
|
||||
? `An error ${statusCode} occurred on server`
|
||||
: 'An error occurred on client'}
|
||||
</p>
|
||||
)
|
||||
}
|
||||
|
||||
Error.getInitialProps = ({ res, err }: NextPageContext) => {
|
||||
const statusCode = res ? res.statusCode : err ? err.statusCode : 404
|
||||
return { statusCode }
|
||||
}
|
||||
|
||||
export default Error
|
||||
Reference in New Issue
Block a user