Cross Language Exceptions
One of the most exciting new features of the CLR and a managed environment is that not only can programs built with different languages interact, but they can also seamlessly share exceptions. When you think about what an exception is and how it needs to be processed (walking stack, continuing execution in a different stack frame, and so on), this interoperability is pretty amazing.
You have seen many examples of how to build an exception class and throw that exception in a number of different languages. Now you will concentrate on the language interoperability when it comes to exceptions thrown under the control of the CLR. Listing 15.19 shows exceptions caught from three different languages. The complete source for ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access