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

WatchDog try-catches make development very tricky #5704

Closed
oskarwrobel opened this issue Nov 4, 2019 · 3 comments
Closed

WatchDog try-catches make development very tricky #5704

oskarwrobel opened this issue Nov 4, 2019 · 3 comments
Assignees
Labels
package:engine package:utils package:watchdog type:task This issue reports a chore (non-production change) and other types of "todos".

Comments

@oskarwrobel
Copy link
Contributor

oskarwrobel commented Nov 4, 2019

E.g. try-catch inside the EmitterMixin#fire.

When you make a simple mistake inside a listener callback (typo or something) it's not easy to find out what happened. The original error is caught, wrapped and rethrown. The stack of the original error is stored as a string inside some nested property. You can't click it to move the place where the error happened. It seriously decreases DX.

I think It should be a flag to disable WatchDog try-catches.

@oskarwrobel oskarwrobel added the type:task This issue reports a chore (non-production change) and other types of "todos". label Nov 4, 2019
@ma2ciek
Copy link
Contributor

ma2ciek commented Nov 4, 2019

I had some ideas about DX improvements in #5595 My last proposal there should be good enough to track original errors.

The latter seems also doable, but harder and tricker, and I think that this shouldn't be needed if the original stack trace would be good.

@Reinmar
Copy link
Member

Reinmar commented Nov 4, 2019

I've had really strong doubts about try-catches from the beginning as it just smelled badly. But since you guys were talking about wrapping only some critical parts of the code, I was curious how it will work.

However:

  • I didn't expect that we're touching places like EmitterMixin#fire(). I thought this was supposed to touch things like Model#change(). I'd say that there's a fundamental difference between a util like the emitter mixin and the base engine's class.
  • I'm still planning to check @ma2ciek's solution to "CKEditor Unexpected error" wrapper makes errors unreadable #5595 but if the results will not feel "native", I'd be for reverting most of try-catch addons.

@Reinmar Reinmar added this to the iteration 28 milestone Nov 4, 2019
@Reinmar
Copy link
Member

Reinmar commented Nov 25, 2019

I reported a separate ticket for moving the try-catch to some other place than EmitterMixin#fire(): #5791.

Other than that, we merged @ma2ciek's ckeditor/ckeditor5-utils#313 so I think we can close this issue too.

@Reinmar Reinmar closed this as completed Nov 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:engine package:utils package:watchdog type:task This issue reports a chore (non-production change) and other types of "todos".
Projects
None yet
Development

No branches or pull requests

3 participants