Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always send an error to client if there is. #1800

Merged
merged 1 commit into from
Apr 25, 2017
Merged

Conversation

arunoda
Copy link
Contributor

@arunoda arunoda commented Apr 25, 2017

Fixes #1798
In the production, we need to send a dummy error.

In the production, we need to send a dummy error.
@arunoda arunoda merged commit 84d00ad into vercel:master Apr 25, 2017
@arunoda arunoda deleted the fix-1798 branch April 25, 2017 04:16
@gcpantazis
Copy link
Contributor

gcpantazis commented Apr 25, 2017

@arunoda So the error won't be sent to the view in production? What if I want to take an action?

My use case is that I want to send that error message to our logs, and the _error.js page is the best single place I see to capture errors that break next on both the client and server. i.e.:

export default class ErrorPage extends React.Component {
    static getInitialProps({res, jsonPageRes, err}) {
        if (err) {
            track.metric('render_error');
            // Utility method that serializes JS errors on client and server, sends them to logs
            track.error(err);
        }

        return {}
    }

    render() {
        return (
            <div>...</div>
        )
    }
}

If we're not consistently sending the error object to the error page, do you have a better way to grab and track them?

@arunoda
Copy link
Contributor Author

arunoda commented Apr 27, 2017

Basically this is intentional. Earlier we haven't sent it at all.
In production, we don't want to send server errors to the client.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants