Skip to content

Commit

Permalink
use custom error page
Browse files Browse the repository at this point in the history
  • Loading branch information
tsubik committed Oct 24, 2024
1 parent b4e8d81 commit 912f47f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { Provider } from 'react-redux';
import App from 'next/app';
import Error from 'next/error';
import Router from 'next/router';
import { createStore, combineReducers, applyMiddleware, compose } from 'redux';
import thunk from 'redux-thunk';
Expand All @@ -21,6 +20,8 @@ import { getOperators } from 'modules/operators';
import GoogleTagManager from 'components/layout/google-tag-manager';
import PageViewTracking from 'components/layout/pageview-tracking';

import Error from 'pages/_error';

import { getCookie, setCookie, deleteCookie } from 'services/cookies';
import { getSession } from 'services/session';

Expand Down Expand Up @@ -144,7 +145,7 @@ class MyApp extends App {
return {};
}

return { pageProps, language, messages, defaultLocale };
return { pageProps, language, messages, defaultLocale, url };
}

componentDidMount() {
Expand All @@ -162,10 +163,10 @@ class MyApp extends App {
}

render() {
const { Component, pageProps, store, defaultLocale, language, messages } = this.props;
const { Component, pageProps, store, defaultLocale, language, messages, url } = this.props;

if (pageProps.errorCode) {
return <Error statusCode={pageProps.errorCode} />;
return <Error statusCode={pageProps.errorCode} url={url} />;
}

return (
Expand Down

0 comments on commit 912f47f

Please sign in to comment.