Fix inconsistent return type
If an error was raised, this yielded a 500 error code, as the return type was inconsistent.
Fixes gitlab-org/gitlab-ce#27150
/cc @lbennett
If an error was raised, this yielded a 500 error code, as the return type was inconsistent.
Fixes gitlab-org/gitlab-ce#27150
/cc @lbennett