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

Additional Data section of Sentry doesn't show current state and the action #3

Closed
maksad opened this issue Oct 2, 2015 · 9 comments

Comments

@maksad
Copy link

maksad commented Oct 2, 2015

The source code shows that if there is an error then the Raven extra fields should have action and current state - store.getState().
However, when intentionally raising an error in my code to catch in Sentry:

  componentWillMount() {
    nonExistingFunctionCalled();
  }

Sentry states only about the session:duration and no any information can be found about action and state.

Here is a screenshot:

screen shot 2015-10-02 at 09 19 54

@Hyra
Copy link

Hyra commented Oct 2, 2015

Same here. Not sure if it's related, but i also get the message 'Error: Raven has not been configured.' in the console.

@ngokevin
Copy link
Owner

ngokevin commented Oct 2, 2015

@maksad the middleware only handles errors raised on actions, not component-level code. Redux middleware wraps every action where we have access to getState, Redux middleware doesn't touch component-level code. Let me know if that makes sense.

@Hyra hmm, are you initializing the middleware with your Sentry DSN? I wonder what's happening there.

@Hyra
Copy link

Hyra commented Oct 2, 2015

@ngokevin: yeah, i just added the middleware like so:

const createStoreWithMiddleware = applyMiddleware(
  thunkMiddleware,
  loggerMiddleware,
  RavenMiddleware('https://******@app.getsentry.com/abcdefg')
)(createStore);

Could it be because I'm running a local webserver on 127.0.0.1 ..

Want me to create a separate ticket for it?

@ngokevin
Copy link
Owner

ngokevin commented Oct 2, 2015

@Hyra yeah you can file another one, i'll check it out. Put all the logs/details you have. thanks!

@Hyra
Copy link

Hyra commented Oct 2, 2015

Done at #4 ! Cheers!

@ngokevin
Copy link
Owner

ngokevin commented Oct 2, 2015

@maksad i'm going to close this. Try triggering the error in an action, or let me know if you have any ideas on how to feed the Redux state into Raven at the component-level.

@ngokevin ngokevin closed this as completed Oct 2, 2015
@maksad
Copy link
Author

maksad commented Oct 2, 2015

Thanks @ngokevin
Yes you are right. I triggered an error in Reducer and it captured the issue:

screen shot 2015-10-02 at 10 44 05

I will write when there will be a proper solution for feeding the Redux state into Raven at the component-level.

@maksad
Copy link
Author

maksad commented Oct 2, 2015

@ngokevin
This code lets you capture an error with the state in the component-level:

RavenMiddleware(
  'https://**************************************@app.getsentry.com/xxxxx',
  {
    collectWindowErrors: true,
    dataCallback: (data) => {
      const store = require('path-to-the-stores/Store');
      if (!(data.extra && data.extra.state)) {
        try {
          data.extra.state = store.getState();
        } catch (expt) {
          console.log(expt);
        }
      }
      return data;
    }
  }
)];

@ngokevin
Copy link
Owner

ngokevin commented Oct 2, 2015

Nice, glad that can be done. Might be worth documenting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants