title: How does an error handler work internally?
body: <p>I know that there has to be quite a lot of documentation about this topic on the internet.
  But doing research for hours without a proper answer is quite frustrating. So I assume I can't put my question in a good phrase. So here the full version:</p>
  
  <p>I'm doing a presentation about try-catch, but it's rather boring to do the basic things. I know what try catch is and I know how it works.
  But here comes the magic: Let's assume I use C++. </p>
  
  <p>The compiler will create a read only list on the heap with structures that give information about the functions in the try-block. That includes pointers for start and end of the routine, information about about the object type of the exception and so on. (Please correct me if I'm wrong)</p>
  
  <p>Okay. Now an exception occurs. The so called error handler (here we go, who is the error handler?) will look up all the data about the failing routine and get the appropriate catch routine. The correct catch is found by comparing the exception object that is generated through the error with the exception objects in the catch.</p>
  
  <p>For example: InvalidCastException (or something like that) is created. There is a catch for that, the error is handled and all objects that are created in the try block are destroyed.</p>
  
  <p>But: How can the program notice that there is an exception? Is this handled by the program, by the runtime or maybe even by the processor (I read something about Ring0 and Ring1, different levels in the CPU oO).</p>