I believe EA should be stable enough to never crash, no matter what an add-in does wrong.
No! It [highlight]must[/highlight] be stable enough.
I wish that the world was that simple.
Firstly, there are crashes within the add-in. (eg. Access a null pointer, an uncaught exception, infinite recursion, double delete) There is no way that EA can catch these circumstances, and because the code is running inside the EA process EA will crash.
The crash described in this thread is this situation. Which leads me to conclude one of three things:
1. The EA function previously didn't throw the exception. (I know changes to results in error conditions have been rejected. Although the one I know about was removing an exception and returning null instead.)
2. The add-in code has changed. Probably not likely. You would have to remove a try-catch from your code and you would know about that.
3. It's not actually a scenario you have previously tested.
On the other hand, EA should be robust enough to handle an add-in doing unexpected things inside a broadcast. But I don't expect our programmers to think of every perverse thing an add-in might do. And even when they do, solving the problem created can be non-trivial.
As an example, if I was handling pre-drop element onto a diagram. I could do any of the following and return to EA that the drop was allowed:
- Tell EA to reload the diagram
- Delete the diagram
- Close the diagram
- Open a different diagram
- Delete the package containing the diagram (or any ancestor)
- Modify the object and force a reload
- Delete the element
- Delete the element containing the diagram (or any ancestor)
- Add the element to the diagram myself
- Close the model
- Start a simulation
- Display an error message to interrupt the drop
I could use a combination of blocking actions, checking objects still exist, checking pointers etc. to try to make EA handle all of these. But I would still be hoping that you didn't think of things that you didn't.
Even if I did, would the time be well spent? Both of you have features that you have requested for EA that haven't been implemented. Would someone dedicating days to try to make this one action survive any add-in sabotage be a higher priority to you than your most sought after features?