Treat uncaught InvalidPathExceptions as '409 Conflict'

If there is an invalid path Paths.get(path) throws an
InvalidPathException. This is a RuntimeException that currently results
in '500 Internal Server Error', not telling the user what is wrong. By
handling this exception the user gets a better error message, e.g.
telling which path is considered as invalid.

E.g. InvalidPathExceptions may be thrown for paths that contain unicode
characters. Whether unicode characters in file names trigger this
exception depends on the local environment of the system that is
running Gerrit (local encoding and locale settings), but we haven't
figured out yet which system properties matter here (e.g. unicode
characters in file names work fine for me when I run tests from Eclipse,
but not when I run the same test via Bazel from the commandline). Since
the behaviour depends on the local system we do not have any
integration test for the code handling InvalidPathExceptions.

Once we figure out which system properties are relevant here, we will
set them in the test environment and then we can have tests with unicode
characters in filenames. Until then the best we can do is being
transparant to users that unicode paths do not work.

Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: I34f0cd30926e02d577480e8efc619ca47b69c821
2 files changed
tree: 551f28dd9549d1d48886ca8e4283bfffadf5fa46
  1. java/
  2. javatests/
  3. proto/
  4. resources/
  5. test/
  6. ui/
  7. .eslintrc.json
  8. .gitignore
  9. .gitreview
  10. bower.json
  11. BUILD
  12. LICENSE
  13. package-lock.json
  14. package.json
  15. README.md
README.md

Gerrit Code Review code-owners plugin

This plugin provides support for defining code owners for files in a repository.

If the code-owners plugin is enabled, changes can only be submitted if all touched files are covered by approvals from code owners.

Also see resources/Documentation/about.md

IMPORTANT: Before installing/enabling the plugin follow the instructions from the setup guide, see resources/Documentation/setup-guide.md