Webclient debug error

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Webclient debug error

LawsonEnglish
http://homepage.mac.com/svc/Reddit.st/

suggests using

(WebClient httpGet: self url) isSuccess

to test for a valid URL.


however if it is  not valid or is poorly formed you get an debugger
error message. e.g. :



(WebClient httpGet: 'http://www.google.com') isSuccess. => true

(WebClient httpGet: 'http://www.google.c') isSuccess   ===>
retry/giveup  (giveup)  ==> primSocket:connectTo:port:   failed
(WebClient httpGet: 'http://gjfdgi436.com') isSuccess   ===>
retry/giveup  (giveup)  ==> primSocket:connectTo:port:   failed

using Seaside 3.0 on squeak 4.1.  and using pristine Squeak 4.1 image.


So, I'm guessing that is a bug. Also, is there another  way to test for
vaid URLs using squeak/seaside?


Lawson










Reply | Threaded
Open this post in threaded view
|

Re: Webclient debug error

Andreas.Raab
On 8/6/2010 6:06 AM, Lawson English wrote:
> http://homepage.mac.com/svc/Reddit.st/
>
> suggests using
>
> (WebClient httpGet: self url) isSuccess
>
> to test for a valid URL.

Looks like this needs to be wrapped into an error handler, e.g.,

        [(WebClient httpGet: self url) isSuccess]
                on: Error do:[:ex| ex return false].

Cheers,
   - Andreas

> however if it is not valid or is poorly formed you get an debugger error
> message. e.g. :
>
>
>
> (WebClient httpGet: 'http://www.google.com') isSuccess. => true
>
> (WebClient httpGet: 'http://www.google.c') isSuccess ===> retry/giveup
> (giveup) ==> primSocket:connectTo:port: failed
> (WebClient httpGet: 'http://gjfdgi436.com') isSuccess ===> retry/giveup
> (giveup) ==> primSocket:connectTo:port: failed
>
> using Seaside 3.0 on squeak 4.1. and using pristine Squeak 4.1 image.
>
>
> So, I'm guessing that is a bug. Also, is there another way to test for
> vaid URLs using squeak/seaside?
>
>
> Lawson
>
>
>
>
>
>
>
>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Webclient debug error

Sven Van Caekenberghe
Hi Andreas,

On 06 Aug 2010, at 18:49, Andreas Raab wrote:

> On 8/6/2010 6:06 AM, Lawson English wrote:
>> http://homepage.mac.com/svc/Reddit.st/
>>
>> suggests using
>>
>> (WebClient httpGet: self url) isSuccess
>>
>> to test for a valid URL.
>
> Looks like this needs to be wrapped into an error handler, e.g.,
>
> [(WebClient httpGet: self url) isSuccess]
> on: Error do:[:ex| ex return false].
>
> Cheers,
>  - Andreas
>
>> however if it is not valid or is poorly formed you get an debugger error
>> message. e.g. :
>>
>>
>>
>> (WebClient httpGet: 'http://www.google.com') isSuccess. => true
>>
>> (WebClient httpGet: 'http://www.google.c') isSuccess ===> retry/giveup
>> (giveup) ==> primSocket:connectTo:port: failed
>> (WebClient httpGet: 'http://gjfdgi436.com') isSuccess ===> retry/giveup
>> (giveup) ==> primSocket:connectTo:port: failed
>>
>> using Seaside 3.0 on squeak 4.1. and using pristine Squeak 4.1 image.
>>
>>
>> So, I'm guessing that is a bug. Also, is there another way to test for
>> vaid URLs using squeak/seaside?
>>
>>
>> Lawson

Thanks for the suggestion, I incorporated the change.
Thanks for reporting this, Lawson.

Sven