Thank you for the details. Indeed, there was a problem with the way LoadAsync method was handling the connection errors. Fix will be included in next release.
If you want to fix it right now yourself, you should patch the following line in unit XData.Web.Dataset.pas (then one in source\core\web folder, pay attention as there is another one in source\core folder), here is the correct method:
function TXDataWebDataSet.LoadAsync: TJSPromise;
begin
Result := TJSPromise.new(
procedure(ASuccess, AFailed: TJSPromiseResolver)
begin
EnsureConnected(
procedure
begin
FOpenResolver := ASuccess;
try
inherited Load([], nil);
except
on E: Exception do
begin
if Assigned(AFailed) then
AFailed(E)
else
raise;
end;
end;
end,
procedure(Error: TXDataWebConnectionError)
begin
AFailed(EXDataWebConnectionException.Create(Error));
end);
end)
end;
The line you should update is this one:
AFailed(EXDataWebConnectionException.Create(Error));