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

Could we expose an optional callback handler to be called here instead of only logging errors? #123

Closed
ansorensen opened this issue Dec 14, 2019 · 3 comments · Fixed by #127
Labels
resolution:resolved This issue was already resolved (e.g. by another ticket). type:improvement
Milestone

Comments

@ansorensen
Copy link

console.error( error );

@ansorensen ansorensen changed the title Could we expose an optional callback handler here instead of swallowing errors? Could we expose an optional callback handler to be called here instead of only oging errors? Dec 14, 2019
@ansorensen ansorensen changed the title Could we expose an optional callback handler to be called here instead of only oging errors? Could we expose an optional callback handler to be called here instead of only logging errors? Dec 14, 2019
@ansorensen
Copy link
Author

Another approach would be to optionally wrap the editor into an error boundary and show the error message there.

@pomek
Copy link
Member

pomek commented Dec 16, 2019

We could provide support for onError attribute but it will be called only if an error occurs during the editor's initialization. If the onError attribute won't be defined, console.log( error ) could be called instead (as a default value).

Is it enough?

@pomek pomek added the pending:feedback This issue is blocked by necessary feedback. label Dec 16, 2019
@ansorensen
Copy link
Author

It's a start! (I can do a pull request this week for this issue). Reading through the CKEditor5 docs, it doesn't look like there's an 'error' event listed in the events. When there is such functionality (and I can try to look into bringing that about), I can probably do a new pull request to expand the onError function here to add an error listener with the callback.

For our current use case, however, the errors we run into are most likely to be initialization issues, so this functionality would allow us to display errors to the users for the most likely cases and make it easier to identify and fix bugs (and eventually log them directly ourselves).

@pomek pomek closed this as completed in #127 Jan 8, 2020
pomek added a commit that referenced this issue Jan 8, 2020
Feature: Introduced support for `onError` callback that is being called if an error occurred during the editor's initialization. Closes #123.

Thanks to @ansorensen.
@Mgsy Mgsy added this to the iteration 29 milestone Jan 8, 2020
@Mgsy Mgsy added resolution:solved type:improvement and removed pending:feedback This issue is blocked by necessary feedback. labels Jan 8, 2020
@Reinmar Reinmar added resolution:resolved This issue was already resolved (e.g. by another ticket). and removed resolution:solved labels Jul 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution:resolved This issue was already resolved (e.g. by another ticket). type:improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants