If a submodule operation cannot be performed we currently always throw a
SubmoduleException. According to its javadoc SubmoduleException messages
are user-visible.
SubmoduleException is thrown in 2 cases:
1. the submodule operation cannot be performed due to conflicts
2. the submodule operation cannot be performed due to an error in Gerrit
For 1. we should return '409 Conflict’, for 2. rather ‘500 Internal
Server Error'. In case of 2. the exception message should not be
returned to users.
To fix this we introduce a SubmoduleConflictException as subclass of
ResourceConflictException that is thrown if there is a conflict when
performing the submodule operation and the user should get a '409
Conflict' response. In case of internal server errors we throw
StorageException now. Since StorageException is a RuntimeException this
cleans up our method signatures a bit.
Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: Icd60fa14a67944543ccf06df38ffee03c5d0c722