Browse Source

Also accept EMathError exception

Pierre Muller 10 months ago
parent
commit
3707000121
1 changed files with 9 additions and 1 deletions
  1. 9 1
      tests/webtbs/tw37468.pp

+ 9 - 1
tests/webtbs/tw37468.pp

@@ -14,11 +14,19 @@ begin
       writeln(power(a,b));
       writeln(power(a,b));
     except
     except
       on e: EZeroDivide do begin
       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);
         writeln(Infinity);
       end;
       end;
     end;
     end;
   except
   except
-    halt(1);
+    on e:Exception do begin
+      writeln('Error: exception at wrong level: ',e.Message);
+      halt(1);
+    end;
   end;
   end;
   writeln('ok');
   writeln('ok');
 end.
 end.