diff --git a/gerrit-common/src/main/java/com/google/gerrit/common/errors/NoSuchEntityException.java b/gerrit-common/src/main/java/com/google/gerrit/common/errors/NoSuchEntityException.java index c47cf07cc0..1829c8b175 100644 --- a/gerrit-common/src/main/java/com/google/gerrit/common/errors/NoSuchEntityException.java +++ b/gerrit-common/src/main/java/com/google/gerrit/common/errors/NoSuchEntityException.java @@ -23,4 +23,8 @@ public class NoSuchEntityException extends Exception { public NoSuchEntityException() { super(MESSAGE); } + + public NoSuchEntityException(String message) { + super(message); + } } diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/BaseServiceImplementation.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/BaseServiceImplementation.java index b124824445..327799247f 100644 --- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/BaseServiceImplementation.java +++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/BaseServiceImplementation.java @@ -72,7 +72,11 @@ public class BaseServiceImplementation { } catch (InvalidQueryException e) { callback.onFailure(e); } catch (NoSuchProjectException e) { - callback.onFailure(new NoSuchEntityException()); + if (e.getMessage() != null) { + callback.onFailure(new NoSuchEntityException(e.getMessage())); + } else { + callback.onFailure(new NoSuchEntityException()); + } } catch (NoSuchGroupException e) { callback.onFailure(new NoSuchEntityException()); } catch (OrmRuntimeException e) {