Good time of the day!
Thank you for your question.
Here is code which I really using in my project:
try
ObjectPush.Open;
// Connected
try
ObjectPus.Put(FileName);
except
ObjectPush.LastError // LastOBEX Error
end;
except
on E: Exception do begin
if Pos('10013', E.Message) > 0 then // Authentication failed
else
if Pos('10060', E.Message) > 0 then // Connection failed
end;