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

Tweaks to error reporting in Tracker. #3822

Closed
wants to merge 5 commits into from
Closed

Tweaks to error reporting in Tracker. #3822

wants to merge 5 commits into from

Conversation

@Slava
Copy link
Member

@Slava Slava commented Feb 26, 2015

  • Allow passing an onError callback to Tracker.autorun.
  • Workaround the issue described in #3655 by logging parts of error message
    separately.

Attempts to fix #3655

@stubailo
Copy link
Contributor

@stubailo stubailo commented Feb 26, 2015

The onError callback doesn't actually help fix #3822, does it? Or would it help because you can throw the error yourself?

@Slava
Copy link
Member Author

@Slava Slava commented Feb 26, 2015

The logging part does help. onError extends the API to make it more flexible and up to the user to handle errors. (errors printed to console are not easy to handle fwiw).

It just occurred to me, this change might "break" some tests as the code doesn't use Meteor._debug anymore.

* @returns {Tracker.Computation}
*/
Tracker.autorun = function (f) {
Tracker.autorun = function (f, onError) {

This comment has been minimized.

@glasser

glasser Mar 3, 2015
Member

Since most users of Tracker.autorun (a very user-visible API) won't use this optional feature, it should probably be a named option?

This comment has been minimized.

@Slava

Slava Mar 17, 2015
Author Member

Will do!

@stubailo
Copy link
Contributor

@stubailo stubailo commented Mar 17, 2015

@Slava ping!

@Slava Slava force-pushed the tracker-errors branch from 0bc289a to a02f97c Mar 17, 2015
@Slava
Copy link
Member Author

@Slava Slava commented Mar 17, 2015

@stubailo @glasser updated the PR. Added a test and made sure that the Meteor._supress_log is handled correctly (since now we print more than one line).

@Slava
Copy link
Member Author

@Slava Slava commented Mar 22, 2015

ping :)

@stubailo
Copy link
Contributor

@stubailo stubailo commented Mar 26, 2015

LGTM

@Slava
Copy link
Member Author

@Slava Slava commented Mar 26, 2015

Yay, merged to release 1.1 branch

(cc @philcockfield)

@Slava Slava closed this Mar 26, 2015
@Slava Slava deleted the tracker-errors branch Mar 26, 2015
@hharnisc
Copy link

@hharnisc hharnisc commented Mar 26, 2015

👍

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

Successfully merging this pull request may close these issues.

4 participants