#217 CLI should display error message on operations that complete with error
Closed: Fixed None Opened 11 years ago by edewata.

Currently the cert-release-hold command will not show any error message if the certificate to be released is not already on-hold.

This is because the RevocationProcessor calls IRequestQueue.processRequest() to process the revocation/unrevocation request. In general the processRequest() will not throw an exception on error, but it will store the error message in the request object. The caller is responsible to check the request status/error as follows:

requestQueue.processRequest(request);
status = request.getRequestStatus();

if (status == RequestStatus.COMPLETE) {
    result = request.getExtDataInInteger(IRequest.RESULT);
    if (result.equals(IRequest.RES_SUCCESS)) {
        // request completed successfully
    } else {
        error = request.getExtDataInString(IRequest.ERROR);
        // request completed with error
    }
}

Ideally the RevocationProcessor should throw an exception when there's an error, but it's not clear yet whether this is the appropriate place because it may affect DoRevoke and DoUnrevoke servlets.

One alternative is to check the request status/error in the CertResourceService and throw an exception there. Another alternative is to let the client (e.g. CertReleaseHoldCLI) check the request status/error, this way the CLI can still get the full request info.


Fixed and pushed to master in c000265fc098b7873302161750f9c86ba703f8ca

Metadata Update from @edewata:
- Issue assigned to kaskahn
- Issue set to the milestone: 10.0.2

7 years ago

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/788

If you want to receive further updates on the issue, please navigate to the
GitHub issue and click on Subscribe button.

Thank you for understanding, and we apologize for any inconvenience.

Login to comment on this ticket.

Metadata