So I have built a custom error page, to allow internationalization. This is working fine. The only way for me to test it though is to enter gibberish as route. For example: localhost:<port>/gibberish
so it will redirect me to the custom error page.
I have been trying to create a page named errortest and inside that page, I want to throw an error with a given statusCode, so NextJs catches it and redirects to the custom error page.
Thing is, I have no idea how to do that.
Something along this:
const ErrorTest = () => {
//Throw Error
};
export default ErrorTest;