AssetFault: how to get it?


Hi all,

Since I’m following the documentation on the Portfolio Asset Service I wonder how I can get to the AssetFault value of each call I make. F.i. when I call the method removeAssetsFromCatalog for an asset the I know is not there, I expect some AssetFault value of ItemNotFound. I can’t seem to find it, nor do I get an exception.

Can you please point me in the right direction?



Most AssetFaults can be revealed with a try - catch block. Here is an example in JAVA:

try {
   service.removeAssetsFromCatalog(sessionId, catalogId, query, false);
} catch (AssetFault_Exception e) {
   String reason = err.getMessage();
   System.out.println("Reason: " + reason);

In the case that you are describing, you are not getting an AssetFault because one is not being thrown.
Basically we followed this logic. If you attempt to delete a record that does not exist, we treat the result as a success. Because, whether the record was there first or not, the end result is that the record is not in the catalog. Which is why you called the method in the first place.

If you have any concerns about this, feel free to let me know.