Excpetion custom |
Smart pascal source code
type E1 = class(Exception) end; type E2 = class(Exception) end; { main.pas } Begin try try raise E1.Create(''); except on e: E1 do WriteLn('Caught E1'); end; except on e: E2 do WriteLn('Caught E2'); end; try try raise E2.Create(''); except on e: E1 do WriteLn('Caught E1'); end; except on e: E2 do WriteLn('Caught E2'); end; { <<< CONSOLE OUTPUTS >>> Caught E1 Caught E2 }