demo icon indicating copy to clipboard operation
demo copied to clipboard

Improve errors when the locale is missing

Open javiereguiluz opened this issue 5 years ago • 0 comments

Related to https://github.com/symfony/symfony-docs/pull/13135.

I don't know if it's technically possible, but I also faced a similar error in the past. Maybe we could create a listener that tries to recover from exceptions? Logic should be:

  • Listen to exceptions
  • In a try ... catch try to load the same URI but with the en prefix (this assumes that you are missing the locale and adds it automatically)
  • If the response of the new URI is an exception, throw the original exception ... otherwise, redirect to the new response.

But maybe this proposal is flawed ... or it's more complicated than some other solution that the community can suggest. Thanks!

javiereguiluz avatar Feb 14 '20 16:02 javiereguiluz