Commit f02d8a6
WIP: Attempt to catch exception and show user error message
Following on from PR 10912 which raises an exception if a computed
base path already exists in Publishing API for a live content item
that has a different content ID...
...currently, we raise an exception in that case, and the user
would just see a "Server Error" message. Ideally we'd want to
catch that exception and show an error message to the user instead,
nudging them to edit their title.
Steps to test locally:
1. Set up a legacy published NewsArticle, with a slug (e.g. 'foo')
2. Try creating a new StandardEdition news article with a title
that would end up generating the same slug (i.e. "Foo").
Currently, on step 2, locally I see the exception introduced in
10912.
In this WIP commit I was expecting to catch the exception and
surface the error to the user, and to still be on the "new
document" screen (with my inputted values retained from the form
submission). But instead, the draft gets created and the slug
gets enumerated (in this example, "foo--2" or something like that).
I'm not sure why the code I've added in this commit causes the
draft to save successfully 🤔1 parent 8492702 commit f02d8a6
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
| 14 | + | |
| 15 | + | |
11 | 16 | | |
12 | 17 | | |
13 | 18 | | |
| |||
0 commit comments