From 6bb8bb6875b7bb68afab2f959b5f529fac41256e Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Fri, 23 Apr 2010 20:51:36 +0000 Subject: [PATCH] Keep SQL errors quite but raise unnormal access violations, so the exception handler can catch them. --- source/tabletools.pas | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/tabletools.pas b/source/tabletools.pas index 016ad7b1..386c10c8 100644 --- a/source/tabletools.pas +++ b/source/tabletools.pas @@ -477,8 +477,12 @@ begin except // The above SQL can easily throw an exception, e.g. if a table is corrupted. // In such cases we create a dummy row, including the error message - on E:Exception do - AddNotes(DBObj.Database, DBObj.Name, 'error', E.Message); + on E:Exception do begin + if E.ClassType = EAccessViolation then + Raise + else + AddNotes(DBObj.Database, DBObj.Name, 'error', E.Message); + end; end else begin AddNotes(DBObj.Database, DBObj.Name, STRSKIPPED+FormatByteNumber(DBObj.Size), ''); end;