From 37b7f89a392abcd4d2e1f250f192f596dce51fab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Van=20Canneyt?= Date: Mon, 3 Feb 2025 11:13:56 +0100 Subject: [PATCH] * Also catch javascript errors --- packages/fpcunit/src/fpcunit.pas | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/fpcunit/src/fpcunit.pas b/packages/fpcunit/src/fpcunit.pas index 1575574..17427b2 100644 --- a/packages/fpcunit/src/fpcunit.pas +++ b/packages/fpcunit/src/fpcunit.pas @@ -570,14 +570,16 @@ begin try protect(ATestCase, Self); except - on E: EIgnoredTest do - AddFailure(ATestCase, E, FIgnoredTests{, ExceptAddr}); - on E: EAssertionFailedError do - AddFailure(ATestCase, E, FFailures{, ExceptAddr}); - on E: Exception do + on EI: EIgnoredTest do + AddFailure(ATestCase, EI, FIgnoredTests{, ExceptAddr}); + on EF: EAssertionFailedError do + AddFailure(ATestCase, EF, FFailures{, ExceptAddr}); + on EE: Exception do begin - AddError(ATestCase, E{, ExceptAddr}); + AddError(ATestCase, EE{, ExceptAddr}); end; + on EJ: TJSError do + AddError(ATestCase, EJSException.Create(EJ){, ExceptAddr}); end; end;