ChangesCollection: Return different text on multiple changes
Users are often confused when looking up a change just says "Not found" when they are sure a change exists, but weren't aware that a search returned multiple changes. Distinguish between these two cases by changing the human-readable text in the response. Change-Id: I87f6cd231be026e2bb48f26e18f11a5485aeb0e9
This commit is contained in:
@@ -92,9 +92,12 @@ public class ChangesCollection implements
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ctls.size() != 1) {
|
||||
if (ctls.isEmpty()) {
|
||||
throw new ResourceNotFoundException(id);
|
||||
}
|
||||
if (ctls.size() != 1) {
|
||||
throw new ResourceNotFoundException("Multiple changes found for " + id);
|
||||
}
|
||||
|
||||
ChangeControl ctl = ctls.get(0);
|
||||
if (!ctl.isVisible(db.get())) {
|
||||
|
||||
Reference in New Issue
Block a user