-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Remove the "catch" statement from samples included in CKEditor 5 builds (?) #1803
Comments
That's a good catch. We could remove the
|
Well to be honest I don't what's worse dummy catch or no Maybe the better solution would be (ps.: remember about the full names, like in .catch( error => {
// Handle the editor initalisation errors - ... (or some better text :P )
console.error( 'There was a problem with initializing the editor', error );
} ); with the above we have: full error logged, no uncaught error in promise logged and better practice with having he But logging the full error will be better then logging only |
That's the point of:
It doesn't work now, but perhaps it can work. The flaws of the current body of the |
Logging the full |
Getting rid of the catch statement was the first idea that came to my mind to solve the real problem that was introduced by "wrong" catch statement. I do agree with both of you that if we can catch errors but at the same time show the full information about the issue (log the full error, whatever) + a custom error message as proposed in #1803 (comment), then it would look more professional, then just getting rid of the catch statement. |
Fixed with a PR in each build: |
Docs: Error messages in manual tests and a sample should be more verbose should the editor fail to initialize (see ckeditor/ckeditor5#1803).
Docs: Error messages in manual tests and a sample should be more verbose should the editor fail to initialize (see ckeditor/ckeditor5#1803).
Docs: Error messages in manual tests and a sample should be more verbose should the editor fail to initialize (see ckeditor/ckeditor5#1803).
Docs: Error messages in manual tests and a sample should be more verbose should the editor fail to initialize (see ckeditor/ckeditor5#1803).
Docs: Error messages in manual tests and a sample should be more verbose should the editor fail to initialize (see ckeditor/ckeditor5#1803).
Docs: Error messages in manual tests and a sample should be more verbose should the editor fail to initialize (see ckeditor/ckeditor5#1803).
I recently encountered an issue when trying to load one of 3rd party plugins into a CKEditor 5 build. Unfortunately the error logged in the console was completely useless:
Only after I commented the catch block, it showed me something meaningful:
It took me a few seconds to understand that I can try getting rid of the catch statement that looked like something that should just show me the correct stack trace, to see if that changes anything:
In order to improve the developer experience, I'd get rid of that statement.
The text was updated successfully, but these errors were encountered: