Exception handling syntax: Difference between revisions

Content deleted Content added
Line 25:
'''begin'''
Do_Something_Interesting;
'''exception''' ''-- Start of exception handlerhandlers''
'''exception'''
'''when''' Constraint_Error =>
''... -- Handle constraint error''
'''when''' Storage_Error =>
''-- Propagate the Storage_Error as a different exception with somea useful message''
'''raise''' Some_Error '''with''' "Out of memory";
'''when''' Error : '''others''' =>
Line 36 ⟶ 35:
Put ("Exception: ");
Put_Line (Exception_Name (Error));
PutPut_Line (Exception_Message (Error));
'''end''' Foo;