pascalabcnet/TestSuite/exceptions2.pas
Бондарев Иван 2b0dc0b76b bug fix #402
2017-05-23 20:36:10 +02:00

16 lines
388 B
ObjectPascal

type
MyException1 = class(Exception);
MyException2 = class(Exception);
IncorrectInputException = class(Exception);
begin
var s := '';
try
raise new MyException1('EXCEPTION2!!');
except
on e: IncorrectInputException do writeln(e.Message);
on e: MyException1 do s := e.Message;
on e: MyException2 do writeln(e.Message);
end;
assert(s = 'EXCEPTION2!!');
end.