I have a MOSS Enterprise server with sp1 applied. I have a simple enough custom list with an event receiver. I have written some validation code in the ItemAdding event and I have code similar to the following:
properties.Cancel = true;
properties.Status = SPEventReceiverStatus.CancelWithError;
properties.ErrorMessage = errorMessage;
I have a web part that adds items to the custom list, in the web part I have some code which catches the SPException thrown afer calling SPListItem.Update(), within the catch block for the SPException I then retrieve the SPException.Message property
and display to the user.
My problem is that I was assuming that the properties.ErrorMessage from the event receiver would be what is used to populate the SPException.Message property - in my case I am getting am SPException.Message property with only the first random amount
of characters from the properties.ErrorMessage property.
Looking at reflector and the call stack in Visual Studio there appears to be an unmanaged/managed transition to the Microsoft.SharePoint.Library.SPRequestInternal class in the Microsoft.SharePoint.Library in the OWSSvrLib.dll file so I cannot find
the point at which the string is truncated but I would at least li
View Complete Post