try
Connection.Connected:=true;
if not(GetConnectionUser.Connection.Connected) then begin
DebugLn('Cannot connect to DB');
end;
except
on E: Exception do begin
DebugLn( 'Connection not possible - Connection Exception: '+ E.Message);
// here you can write the exception to a file if you want
end;
end;