Don't raise exception when user enters an invalid filter, rather do that with a normal error dialog. Fixes issue #1559.

This commit is contained in:
Ansgar Becker
2009-12-23 17:51:57 +00:00
parent 6a1df0b488
commit 92eeced113

View File

@ -6387,13 +6387,16 @@ begin
try
Results := Connection.GetResults(query);
except
// if something bad happened, nuke cache, reset cursor and display error.
TVirtualStringTree(Sender).RootNodeCount := 0;
SetLength(res.Rows, 0);
ReachedEOT := true;
ShowStatus(STATUS_MSG_READY);
Screen.Cursor := crDefault;
raise;
on E:Exception do begin
// if something bad happened, nuke cache, reset cursor and display error.
TVirtualStringTree(Sender).RootNodeCount := 0;
SetLength(res.Rows, 0);
ReachedEOT := true;
ShowStatus(STATUS_MSG_READY);
Screen.Cursor := crDefault;
MessageDlg(E.Message, mtError, [mbOK], 0);
Exit;
end;
end;
if Cardinal(Results.RecordCount) < limit then begin
limit := Results.RecordCount;