The UGSubsystem.findUsers() takes a filter and searches for all matching users. Currently it throws an exception if the search returns no matching users. See UGSubsystem.java:413-416:
// if v contains nothing, just throw exception if (v.size() == 0) { throw new EUsrGrpException(CMS.getUserMessage("CMS_USRGRP_USER_NOT_FOUND")); }
While throwing exception might be fine for certain methods, this is inappropriate for findUsers() since empty result is a valid result. For example, CLI or UI should show an empty result instead of an error message.
Also the no result exception is almost indistinguishable from other real errors because it's using the same EUsrGrpException class. For now the exception handler would have to compare the exception message in order to determine the appropriate action. Exception messages are meant to be read by human, they are not supposed to be used to determine program flow.
This issue may also exist in other search operations that return multiple results.
proposed Milestone: 10.2.3 - Per Dogtag 10.2.3 meeting of 09/25/2014
Per Dogtag 10.2.X meeting of 01/14/2015: Milestone 10.3
Metadata Update from @edewata: - Issue set to the milestone: UNTRIAGED
Dogtag PKI is moving from Pagure issues to GitHub issues. This means that existing or new issues will be reported and tracked through Dogtag PKI's GitHub Issue tracker.
This issue has been cloned to GitHub and is available here: https://github.com/dogtagpki/pki/issues/1481
If you want to receive further updates on the issue, please navigate to the GitHub issue and click on Subscribe button.
Subscribe
Thank you for understanding, and we apologize for any inconvenience.
Metadata Update from @dmoluguw: - Issue close_status updated to: migrated - Issue status updated to: Closed (was: Open)