application-centric. thanks for making my argument.
-----Original Message-----
From: Dirk Verbeeck [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 27, 2001 6:03 PM
To: [EMAIL PROTECTED]
Subject: Re: [httpclient] Planning proposal
"Sale, Doug" wrote:
> morgan:
> > > Case in point: HttpClient throws an HttpException in the event of
> a 401.
> > > While this is probably perfectly reasonable behaviour for Slide,
> it's not
> > > good for lots of other applications. First of all, a server
> returning a 401
> > > is a normal condition, not an error condition. Secondly, the web
> server
> > > will return potentially useful Headers with a 401, which are only
> available
> > > if the request is processed normally.
>
> dirk:
> > Aren't the headers available in the method ? If not, we should
> change that.
> > Returning an error code or throwing an exception, it's just a matter
> of taste,
> > you always have to do a test and with exceptions the compiler
> reminds you.
>
> returning an error code? it's an HTTP *status* code. it doesn't
> indicate an excpetion condition in the httpclient. if an application
> that uses httpclient wants to throw an exception when receiving an
> unfavorable HTTP *status* code, that is it's choice.
>
> -doug
You call PutMethod to create a new file on the server but you are not
authorized to do so and you get an exception (401 Unauthorized)
Just like java.io.File.createNewFile() throws SecurityException when
you are not permitted to write to the local filesystem.
Dirk
