Also accept EMathError exception

This commit is contained in:
Pierre Muller 2024-09-25 05:55:17 -07:00
parent cbd4e681d0
commit 3707000121

View File

@ -14,11 +14,19 @@ begin
writeln(power(a,b));
except
on e: EZeroDivide do begin
writeln('EZeroDivide Exception: ',e.Message);
writeln(Infinity);
end;
on e: EMathError do begin
writeln('MathError Exception: ',e.Message);
writeln(Infinity);
end;
end;
except
halt(1);
on e:Exception do begin
writeln('Error: exception at wrong level: ',e.Message);
halt(1);
end;
end;
writeln('ok');
end.