Skip to content

Latest commit

 

History

History
24 lines (19 loc) · 687 Bytes

ii.19.3-catch-blocks.md

File metadata and controls

24 lines (19 loc) · 687 Bytes

II.19.3 Catch blocks

A catch block is declared using the catch keyword. This specifies the type of exception object the clause is designed to handle, and the handler code itself.

SEHClause ::=
catch TypeReference HandlerBlock

[Example:

.try {
  …                            // protected instructions
  leave exitSEH                // normal exit
}
catch [mscorlib]System.FormatException {
  …                            // handle the exception
  pop                          // pop the exception object
  leave exitSEH                // leave catch handler
}
exitSEH:                       // continue here

end example]