Arno Garrels wrote:
> {code}
> procedure THttpCli.DoRequestSync(Rq : THttpRequest);
> [..]
> {* Jul 12, 2004
> WARNING: The component now doesn't consider 401 status
> as a fatal error (no exception is triggered). This
> required a change in the application code if it was using
> the exception that is no more triggered for status 401 and
> 407. *}
> {* if FStatusCode > 401 then Dec 14, 2004 *}
> if (FRequestDoneError <> 0) or ( <== added
> (FStatusCode >= 400) and (FStatusCode <> 401) and (FStatusCode
> <> 407)) then begin
> if FRequestDoneError <> 0 then <== added
> raise EHttpException.Create(FReasonPhrase,
> FRequestDoneError) <== added else
> raise EHttpException.Create(FReasonPhrase, FStatusCode);
> end;
> {code}
>
Ouch, the same can be achieved easier of cause:
{code}
procedure THttpCli.DoRequestSync(Rq : THttpRequest);
[..]
{* Jul 12, 2004
WARNING: The component now doesn't consider 401 status
as a fatal error (no exception is triggered). This required a
change in the application code if it was using the exception that
is no more triggered for status 401 and 407.
*}
{* if FStatusCode > 401 then Dec 14, 2004 *}
if FRequestDoneError <> 0 then <== added
raise EHttpException.Create(FReasonPhrase, FRequestDoneError) <== added
else if (FStatusCode >= 400) and (FStatusCode <> 401) and (FStatusCode <>
407) then
raise EHttpException.Create(FReasonPhrase, FStatusCode);
{code}
--
Arno Garrels
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be