silverwolf-x's picture
download
raw
579 Bytes
import React from 'react'
class Error extends React.Component {
static async getInitialProps({ req, res, err }) {
if (!req.url.startsWith('/404') && !req.url.startsWith('/500')) {
await Promise.reject(new Error('an error in error'))
}
const statusCode = res ? res.statusCode : err ? err.statusCode : null
return { statusCode }
}
render() {
return (
<p>
{this.props.statusCode
? `An error ${this.props.statusCode} occurred on server`
: 'An error occurred on client'}
</p>
)
}
}
export default Error

Xet Storage Details

Size:
579 Bytes
·
Xet hash:
b17dda04aa108c879d3885d0f6b14daede845710a0959bc7de1fa39c200a27fe

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.