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

When deserializeWebviewPanel fails, we should be able to display an error message in a better way #96761

Closed
tamuratak opened this issue May 1, 2020 · 2 comments
Assignees
Labels
info-needed Issue requires more information from poster webview Webview issues

Comments

@tamuratak
Copy link
Contributor

tamuratak commented May 1, 2020

When we can not restore Webview with WebviewPanelSerializer.deserializeWebviewPanel, we should be able to display an error message on each Webview, or in other much better ways.

Typically, when files we wanted to preview on Webview have been removed, we cannot restore the Webview. In those cases, the current API gives extension authors no way to tell users what went wrong. Although the authors can use showErrorMessage or showInformationMessage, it does not seem an appropriate way when multiple restoring fails at the same time. We should be able to tell users what went wrong on each Webview.

Since restoring Notebook, #95361, would easily fail, extension authors of Notebook would need this feature.

@mjbvz mjbvz self-assigned this May 1, 2020
@mjbvz
Copy link
Collaborator

mjbvz commented May 2, 2020

Can you explain what problem you are running into and the use case for this proposal?

Webviews are already free to show their own error message if they cannot restore themselves properly (such as if the file they were previewing no longer exists). However VS Code will show a generic error message if the webview throws an uncaught exception while restoring a webview

@mjbvz mjbvz added info-needed Issue requires more information from poster webview Webview issues labels May 2, 2020
@tamuratak
Copy link
Contributor Author

I missed that we could use Webview itself to display error messages.

WebviewPanelSerializer.deserializeWebviewPanel really works well. Thank you.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster webview Webview issues
Projects
None yet
Development

No branches or pull requests

2 participants