It seems MS might have changed something internally in the way CRM365 handles errors and passes them "up" to clients.
Specifically, we have a bit of code that throws an exception via plugins (using the standard InvalidPluginExecutionException class); the twist is we're specifying our own ErrorCode property when creating this Exception. We were able to "pick up" this error code later on in a console application that was used for automation, but it seems this custom code is now lost.
The "throwing" plugin code:
throw new InvalidPluginExecutionException(OperationStatus.Succeeded, ExceptionCodes.SkipExceptionCode, SkippingMessage(SSTicksInMessage, SSTicksInSystem));
The "catching" code looks like this:
try{ ...}catch (System.ServiceModel.FaultException<Microsoft.Xrm.Sdk.OrganizationServiceFault> ex) when (IsSkipException(ex)){ ...}
The "IsSkipException" method would check the exception details' (which contains the actual exception OrganizationServiceFault stack) for the ErrorDetail "SubErrorCode". This "SubErrorCode" detail DOES exist, but no longer contains our value and instead -2146233088 (our own value was a positive number).
Any idea if this is a mishap on part of MS and they'll revert their change, or if there's some new way to throw exceptions WITH custom properties from plugins?
PS. We can of course make a small change and look for the exception message string (or part of thereof), but that's kind of an ugly way of doing things...






