Skip to content

Handle Snippet Errors in Vue

Summary

When creating or editing a snippet with the snippets_edit_vue FF enabled, errors raised during creation/update are not quite handled correctly.

With creation error:

An error message is briefly displayed and then a redirect back to the form happens, which clears the form and removes the error:

2020-05-14_10.26.00

With update error:

An error message is briefly displayed and then the user is redirected back to the 'show' view, losing the message and the changes:

2020-05-14_10.27.34

Steps to reproduce:

  • Ensure snippets_edit_vue feature flag is enabled (Feature.enable(:snippets_edit_vue) in Rails console)
  • Navigate to the new or edit snippet form
  • Fill invalid://file/path into the title, to trigger a create or update error
  • Submit the form
Edited by 🤖 GitLab Bot 🤖