Can someone point me towards the documentation for Java Exceptions.
For example, I am trying to catch
WARNING: ns0:MemberService.CouldNotUpdateGroup : Could not add a member: 'Specified parent-child relationship already exists.' [E662437895]
Hi Austin,
In the Java sample code for CWS you’ll note that exceptions are of type SOAPFaultException, and that in the catch blocks such exceptions have a .getFault method. You can use the resulting Fault object to extract both the error code and message that were thrown.
Identifying a particular error code can be very useful, as you are planning to do. To obtain an error code that does not contain namespace identifiers, and an error message that has not been wrapped by higher-level code I do something similar to the following:
try { MemberService...()}catch (SOAPFaultException e) { SOAPFault fault = e.getFault(); String errorCode = fault.getFaultCodeAsQName().getLocalPart(); String errorString = fault.getFaultString(); if (errorCode.equals("MemberService.CouldNotUpdateGroup")) { // handle special case ... } else { // tellUser (errorString) ... }}
Hope this helps,
-chris
Hi Chris,
Thanks for your reply, much appreciated.
I was hoping that there was a more straightforward way of detailing the error, at least to extract the error code "E662437895"
I don't suppose you know of a list of these codes with the associated messages?
Cheers,
Austin
I’m not aware of any list of these internal CS error codes. I use CSIDE to decode them (Builder works too) with error.inttoerror.
Of course, you can always ask here too. That one is “Specified parent-child relationship already exists.”
Most times the CS thread log will already have more explicit logging around these sorts of things so that’s a good place to check for additional context first. I usually only have to translate these things if I’m debugging a trace file, or something along those lines.
AK
From: eLink Entry: Content Web Services Forum [mailto:otdncontentwebservices971forum@elinkkc.opentext.com]Sent: Wednesday, June 6, 2018 4:28 AMTo: eLink Recipient <devnull@elinkkc.opentext.com>Subject: Content Web Services - Java Exceptions - Documentation
Content Web Services - Java Exceptions - Documentation
Posted bygaughana@ebrd.com (Gaughan, Austin) On 06/06/2018 04:17 AM
[To post a comment, use the normal reply function]
Topic:
Forum:
Content Web Services Forum
Content Server:
My Support
The number beginning with E is not a Content Web Services code, it is the internal code that the implementation encountered. Your Java program would switch on the Content Web Services error code, which in your example is ‘MemberService.CouldNotUpdateGroup’. (This is not extracted from the error message; the code snippet I showed distinguishes the error code from the error message.)
Thanks,
From: eLink Entry: Content Web Services Forum [mailto:otdncontentwebservices971forum@elinkkc.opentext.com]Sent: Wednesday, June 06, 2018 1:28 AMTo: eLink Recipient <devnull@elinkkc.opentext.com>Subject: Content Web Services - Java Exceptions - Documentation
To catch an exception associated with CWS call you just need to handle SOAPFaultException as suggested. From the error you posted , 'Specified parent-child relationship already exists' is the error string that has been mapped with error code 662437895. You can find a list of such error codes with the associated messages under CS installation directory. There would be a folder named 'res' under which you can find a bunch of properties files populated with error codes along with messages.
HTH,
Brahmaji.