[PATCH] 67 Added REST error handler.
If a REST method returns a Response object it has to be handled manually. A new getEntity() method has been added to obtain the entity from the Response object and also map HTTP errors into exceptions. Ticket #161 -- Endi S. Dewata
On 6/7/2012 9:29 AM, Endi Sukma Dewata wrote:
If a REST method returns a Response object it has to be handled manually. A new getEntity() method has been added to obtain the entity from the Response object and also map HTTP errors into exceptions.
Ticket #161
New patch attached. Same code, revised patch description. -- Endi S. Dewata
ACK .. tested by trying to add a user twice. [root@alee-workpc profile_test]# pki -p 9410 user-add agent2 --email agent2@redhat.com --fullName "Agent Two" --password redhat123 --phone 5551212 CMSException: Failed to add user It would be nice if the exception told me why the user was not added. Perhaps you can revisit the user exception code and make sure its descriptive enough -- In this case, it fails because I tried to add the same user twice. On Tue, 2012-06-26 at 19:15 -0500, Endi Sukma Dewata wrote:
On 6/7/2012 9:29 AM, Endi Sukma Dewata wrote:
If a REST method returns a Response object it has to be handled manually. A new getEntity() method has been added to obtain the entity from the Response object and also map HTTP errors into exceptions.
Ticket #161
New patch attached. Same code, revised patch description.
_______________________________________________ Pki-devel mailing list Pki-devel@redhat.com https://www.redhat.com/mailman/listinfo/pki-devel
On 6/27/2012 3:22 PM, Ade Lee wrote:
ACK .. tested by trying to add a user twice.
Rebased and pushed to master. Thanks.
[root@alee-workpc profile_test]# pki -p 9410 user-add agent2 --email agent2@redhat.com --fullName "Agent Two" --password redhat123 --phone 5551212 CMSException: Failed to add user
It would be nice if the exception told me why the user was not added. Perhaps you can revisit the user exception code and make sure its descriptive enough -- In this case, it fails because I tried to add the same user twice.
The original failure is most likely caused by LDAP exception (entry already exists). The error description is recorded in the log, but it's not returned to the client (same behavior as in the original servlet). The server returns a message CMS_USRGRP_USER_ADD_FAILED which doesn't contain a space to put the error description. This will be fixed in this ticket: https://fedorahosted.org/pki/ticket/214 -- Endi S. Dewata
participants (2)
-
Ade Lee -
Endi Sukma Dewata