locked
Catch All Dsl Exceptions RRS feed

  • Question

  • Hi everyone!

     

    Does anyone know how can I catch all the exceptions that are generated on the generated designer at runtime?

     

    Thank you all!

     

    BCoelho

    Monday, June 4, 2007 4:24 PM

Answers

  • I'm afraid there isn't an equivalent of Application_Error; ASP has the advantage that (at least from the server point of view) there is a single point of entry - everything stems from the http request from the client.

     

    With a target designer, calls to the target designer code could orginate from a number of different sources (e.g. the toolbox, mouse movements, command menu clicks, design surface clicks, the model explorer, the property grid etc...), so there isn't a global event handler.

     

    Duncan

    Monday, June 11, 2007 8:54 PM

All replies

  • BCoelho,

     

    All of the DSL-specific exceptions derive from Microsoft.VisualStudio.Modeling.ModelingException, which is defined in Microsoft.VisualStudio.Modeling.Sdk.dll, so if you catch this exception you will know that there is a model-related problem.

     

    However, a target designer might throw other "general" .Net exceptions where appropriate (such as ArgumentNullException).

     

    Is there a particular scenario that you need to handle?

     

    Duncan

    Tuesday, June 5, 2007 11:05 AM
  • Actually no.

    What I really wanted is a place or method to override where I can catch all exceptions that can occur at runtime.

    Just like Application_Error in the global.asax file in the ASP world.

    Thank you!
    Sunday, June 10, 2007 6:05 PM
  • I'm afraid there isn't an equivalent of Application_Error; ASP has the advantage that (at least from the server point of view) there is a single point of entry - everything stems from the http request from the client.

     

    With a target designer, calls to the target designer code could orginate from a number of different sources (e.g. the toolbox, mouse movements, command menu clicks, design surface clicks, the model explorer, the property grid etc...), so there isn't a global event handler.

     

    Duncan

    Monday, June 11, 2007 8:54 PM