Add-ins Experienced a Serious Error

Add-ins Experienced a Serious Error

swfaust
Advocate Advocate
936 Views
7 Replies
Message 1 of 8

Add-ins Experienced a Serious Error

swfaust
Advocate
Advocate

I have an add-in that creates an external keynote resource server and of course sometimes there is an issue accessing the data for one reason or another.  In case of this I have my code catching exceptions and notifying the user like this:

 

try
{
    ...Do the reload...
}
catch(Exception ex)
{
_logger.Info("Keynote Server Exception:\r\n" + ex);
KMApplication.NotifyService.ShowNotification("Error in keynote server:\n\n" + ex.Message, License.Core.Enums.NotificationIcon.Error);
loadResults.LoadStatus = ExternalResourceLoadStatus.ServerThrewException;
}

When I get an issue the regular notification is shown to the user like I want, but they also get a generic Revit dialog like the attached that informs them of a 'serious error'.  I have googled around but can't figure out exactly where this dialog is coming from or how I can suppress it.  I would like to handle the notification to the user myself and let them know what went wrong and NOT have Revit tell them that something is broken.

 

Does anyone know where this dialog is generated from and how to avoid it?

0 Likes
937 Views
7 Replies
Replies (7)
Message 2 of 8

Moustafa_K
Collaborator
Collaborator

may be if you check the journals, you might find something that help? but my initial guess is that there might be un closed transaction, or something is not disposed.

Moustafa Khalil
Cropped-Sharp-Bim-500x125-Autodesk-1
Message 3 of 8

swfaust
Advocate
Advocate

Hm, ok I will look into those.  It's currently not happening on my machine so I'll have to try to get journals from the user...

0 Likes
Message 4 of 8

CJModis
Advocate
Advocate

Have you events and/or Tasks (Threads) in your add-in?

0 Likes
Message 5 of 8

swfaust
Advocate
Advocate

I do but they should all be finish by this time...  I will double check and make sure they are...

0 Likes
Message 6 of 8

CJModis
Advocate
Advocate

The fact is that event handlers may not work in the context of your plugin, but in the context of Revit itself. Then the exceptions will not be caught. Try event processing inside the Dispatcher

0 Likes
Message 7 of 8

swfaust
Advocate
Advocate

I'm fairly confident that none of my event handlers or task based processing fire between the end of this handler and the error message but I will check and see if I can verify that 100%...

0 Likes
Message 8 of 8

Sean_Page
Collaborator
Collaborator

It may also be very helpful to get the Details of the "Serious Error" dialog to see what additional information it has. It may give better insight into where it is happening and why is causing it.

Sean Page, AIA, NCARB, LEED AP
Partner, Computational Designer, Architect
0 Likes