THRIFT-4863 better indication of WinHTTP errors
Client: Delphi
Patch: Jens Geyer
diff --git a/lib/delphi/src/Thrift.WinHTTP.pas b/lib/delphi/src/Thrift.WinHTTP.pas
index 0d824b6..6ad8400 100644
--- a/lib/delphi/src/Thrift.WinHTTP.pas
+++ b/lib/delphi/src/Thrift.WinHTTP.pas
@@ -497,6 +497,7 @@
PWideChar(Pointer(aProxy)), // may be nil
PWideChar(Pointer(aProxyBypass)), // may be nil
aFlags);
+ if handle = nil then RaiseLastOSError;
inherited Create( handle);
end;
@@ -527,6 +528,7 @@
begin
FSession := aSession;
handle := WinHttpConnect( FSession.Handle, PWideChar(aHostName), aPort, 0);
+ if handle = nil then RaiseLastOSError;
inherited Create( handle);
end;
@@ -572,6 +574,7 @@
PWideChar(aReferrer),
@accept,
aFlags);
+ if handle = nil then RaiseLastOSError;
inherited Create( handle);
end;