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:
parent
7b07b3372e
commit
3b3ef3cb2d
@ -23,4 +23,8 @@ public class NoSuchEntityException extends Exception {
|
||||
public NoSuchEntityException() {
|
||||
super(MESSAGE);
|
||||
}
|
||||
|
||||
public NoSuchEntityException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user