close
Skip to content

Better error handling when creating a new page from the inline link popover #57266

@afercia

Description

@afercia

Description

It appears that when creating a new page from the inline link popover, error notices are shown within the popover. In some cases, the error notice message appears to actually be th etext of a JS error. Not sure this is the best feedback we can provide to users. Screenshot:

Screenshot 2023-12-20 at 14 36 16

I'a adgue an error message like Cannot read properties of undefined (reading 'id') should bever be exposed to users. A more understandable text should be provided.

In the Site editor, thes errors are better handled, at least the text is more user friendly. However, the displaying of the error is inconsistent as it uses a snackbar notice instead of an 'in place' notice. Screenshot:

Screenshot 2023-12-20 at 14 34 39

I'd think there should be some consistency and both places shoul duse the same notice type.

Step-by-step reproduction instructions

  • Go the post Editor, click on a paragraph and click the 'Link' button in the block toolbar.
  • Type something that doesn't match any existing post.
  • At the bottom of the suggestions you will get a control 'Create page: {the string you typed}'
  • To trigger the error message, open your browser's dev tools > Network tab and set your browser to 'Offline'.
  • Now click 'Create page: {the string you typed}'
  • Observe the unfriendly error message displayed in the notice within the link popover.
  • Set your browser back to online.
  • Go to the Site Editor > Pages
  • Click the 'Draft a new page` button (the one with the plus icon)
  • A modal dialot to creat a new page draft opens.
  • To trigger the error message, open your browser's dev tools > Network tab and set your browser to 'Offline'.
  • Enter a page draf ttile and click 'Create draft'.
  • Observe a snackbar notice appears with a friendly error message: 'You are probably offline.'

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions