event of an exception; TraceId gives access to the exception information finally % Code will be executed regardles however the other parts behave end try X++ public static void Main(Args _args) { try { // Code that could throw an exception. } catch (Exception::Error) // Or any other exception type. { // Process the error. } catch { // Process any other exception type not handled previously. } // Code here will execute as long as any exception is caught. } References See also Exception handling for the semantics of exception handling Syntax for definition of syntax in computer science Programming language syntax Control flow Articles with example code Programming language comparisons Articles with example Python (programming language) code Articles with example R code