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

Cannot log errors from Plotly into error tracking service #3105

Closed
sporto opened this issue Oct 15, 2018 · 6 comments
Closed

Cannot log errors from Plotly into error tracking service #3105

sporto opened this issue Oct 15, 2018 · 6 comments
Labels
feature something new

Comments

@sporto
Copy link

sporto commented Oct 15, 2018

Plotly logs some errors using its own logger:

https://github.com/plotly/plotly.js/blob/master/src/lib/loggers.js

This uses console.error. I understand that the console has its own exception handling that is not part of the page.

So an error tracking service like rollbar doesn't catch this and thus the error is not logged.

We would like to see those errors in Rollbar so we can investigate them.
Thanks

@sporto sporto changed the title Cannot log errors from Plotly in error tracking service Cannot log errors from Plotly into error tracking service Oct 15, 2018
@antoinerg antoinerg added the feature something new label Oct 15, 2018
@antoinerg
Copy link
Contributor

antoinerg commented Oct 15, 2018

Hello @sporto and thank you for your interest in plotly.js!

Is my understanding correct that Rollbar would work if an ErrorEvent was fired in the following function: (

loggers.error = function() {

If so, it would be a pretty small change. I could submit a PR for it!

@sporto
Copy link
Author

sporto commented Oct 15, 2018

I'm unsure. I tried something like this in the console

var error = new ErrorEvent('Oh no', {
    error : new Error('ERROR'),
    message : 'Some message',
    lineno : 402,
    filename : 'index.html'
});

var target = document.getElementsByTagName("body")[0]

target.dispatchEvent(error)

Nothing was logged in Rollbar

@etpinard
Copy link
Contributor

I understand that the console has its own exception handling that is not part of the page.

Console errors should be part of the page if you call Plotly.setPlotConfig({logging: 2}) somewhere before your plot call.

@etpinard
Copy link
Contributor

.... which is info our doc pages probably lack at the moment. Thanks for writing in.

@sporto
Copy link
Author

sporto commented Oct 28, 2018

We added Plotly.setPlotConfig({logging: 2}) a few days ago. I'm still seeing the error in the console e.g.

ERROR: TypeError: Cannot read property 'fillcolor' of undefined
    at SVGPathElement.<anonymous> (plotly-basic.js:19501)

But we can't see anything in rollbar yet. So unfortunatelly logging: 2 hasn't done any difference.

@gvwilson
Copy link
Contributor

Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson

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

No branches or pull requests

4 participants