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

JS-Exception handling not working with disabled ErrorTracking Plugin #3704

Closed
OllisGit opened this issue Aug 25, 2020 · 4 comments
Closed

JS-Exception handling not working with disabled ErrorTracking Plugin #3704

OllisGit opened this issue Aug 25, 2020 · 4 comments
Labels
approved Issue has been approved by the bot or manually for further processing bug Issue describes a bug done Done but not yet released
Milestone

Comments

@OllisGit
Copy link
Contributor

What were you doing?

During development of a new Plugin sometimes I use wrong KnockJS Bindings.
E.g.

viewModel.myProperty = ko.observable();
...
<span data-bind:"text: viewModel.mmmProperty">

Expected behaviour in the development console of the browser:

...ReferenceError: Unable to process binding "text: function(){return viewModel.mmProperty }"...

I disabled the ErroTracking-Plugin. Now I always receive a not helpful error message:

...ReferenceError: Sentry is not defined...

Reason:
https://github.com/OctoPrint/OctoPrint/blob/devel/src/octoprint/static/js/app/main.js#L681

} catch (exc) {
	if (Sentry) {

The variable Sentry doesn't exists.

Solution:
Replace if (Sentry){ with if (typeof Sentry !=='undefined') {

see previous description

What did you expect to happen?

"Real" Error description should appear in the Browser console

What happened instead?

An other exception occurs, because the error-handling had an error ;-)

Did the same happen when running OctoPrint in safe mode?

No, because my custom plugins were disabled.

Version of OctoPrint

Latest, 1.4.2. in OP 1.3.10 it is working

Operating System running OctoPrint

OctoPi

Printer model & used firmware incl. version

ANET E10

Browser and version of browser, operating system running browser

Chrome V84

Link to octoprint.log

Not needed, because it is a client side issue.

Link to contents of terminal tab or serial.log

Not needed, because it is a client side issue.

Link to contents of Javascript console in the browser

See above

Screenshot(s)/video(s) showing the problem:

See above

I have read the FAQ.
Yes

@GitIssueBot GitIssueBot added the triage This issue needs triage label Aug 25, 2020
@cp2004
Copy link
Member

cp2004 commented Aug 26, 2020

@OllisGit Tried this and it does block the whole UI from running. Haven't had a chance to test out your fix, but would you like to make a PR, seeing as you've done the hard work finding it :) ? If not, and I can try your fix and add it to the PR stack for when Gina comes back next week.

@cp2004 cp2004 added bug Issue describes a bug and removed triage This issue needs triage labels Aug 26, 2020
OllisGit added a commit to OllisGit/OctoPrint that referenced this issue Aug 27, 2020
OllisGit added a commit to OllisGit/OctoPrint that referenced this issue Aug 27, 2020
@OllisGit
Copy link
Contributor Author

@cp2004 fyi: PR is created: #3706

Thx, for looking into
Olli

foosel pushed a commit that referenced this issue Sep 3, 2020
  * #3704 Correction of Sentry Handling
@foosel
Copy link
Member

foosel commented Sep 3, 2020

And merged, thanks! Fix be released with 1.5.x.

@foosel foosel added the done Done but not yet released label Sep 3, 2020
@foosel foosel added this to the 1.5.0 milestone Sep 3, 2020
@foosel foosel added the approved Issue has been approved by the bot or manually for further processing label Oct 8, 2020
@foosel
Copy link
Member

foosel commented Nov 30, 2020

1.5.0 has just been released.

@foosel foosel closed this as completed Nov 30, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Issue has been approved by the bot or manually for further processing bug Issue describes a bug done Done but not yet released
Projects
None yet
Development

No branches or pull requests

4 participants