Fix: wrong error message on MyWatchedProjectsScreen

Try to add a project to watched projects list, if this
project does not exist for some reason, e.g. typo, Gerrit
will report an error message: "The page you requested was
not found, or you do not have permission to view this page".
The error message is wrong.

Fixed. with this commit the error message will be
"Project not found:<project name>".

Change-Id: Ia8c61a57b93c8214ab922f21c750602b6d9d3f79
This commit is contained in:
Bruce Zu 2013-04-09 15:37:34 +08:00
parent 7b07b3372e
commit 3b3ef3cb2d
2 changed files with 9 additions and 1 deletions

View File

@ -23,4 +23,8 @@ public class NoSuchEntityException extends Exception {
public NoSuchEntityException() {
super(MESSAGE);
}
public NoSuchEntityException(String message) {
super(message);
}
}

View File

@ -72,7 +72,11 @@ public class BaseServiceImplementation {
} catch (InvalidQueryException e) {
callback.onFailure(e);
} catch (NoSuchProjectException e) {
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) {