If you use Tracing in your plugin, and you enable exceptions in your System Settings you should be able to see and get information within the plugin. Then you should be able to see the trace log in the Plugin Trace Log
Within the plugin:
protected void ExecutePostAccountCreate(LocalPluginContext localContext)
{
if (localContext == null)
{
throw new ArgumentNullException("localContext");
}
// ProcessCustomerRelationship(localContext);
string entityName = localContext.PluginExecutionContext.PrimaryEntityName;
Guid entityId = localContext.PluginExecutionContext.PrimaryEntityId;
ITracingService tracingService = localContext.TracingService;
tracingService.Trace("Entered {0} Plugin Method", "ExecutePostACcountCreate");
CreateAccountLogic(entityName, entityId);
}
Enter tracing wherever you need in your AccountLogic function to get the information that you need back:
void CreateAccountLog(string entityName, Guid entityId)
{
tracingService.Trace("Entity Name is {0} ", entityName);
}
In System Settings, Go to Customizations tab, and under Plugin and custom workflow activity tracing, select Exception
Run you process again, and go to Plugin Trace Log under Settings. You should be able to see the errors that you encountered there...
Hope this helps.