From: Kevin Olbrich Date: 2006-09-05T20:49:57+09:00 Subject: Re: Conditional test : going crazy On Tuesday, September 05, 2006, at 6:29 PM, Alex Young wrote: >Zouplaz wrote: >> Hello, I'm goind crazy with this piece of code >> >> response = @http.get(url, headers) >> raise "url #{url} unreachable on host #{@host}:#{@port} - code >> #{response.code}" if response.code != 200 >> >> >> The exception is raised even when response.code contains 200 !! >> >> What's wrong ? >The response code isn't a number, it's a string. Try: > >... if response.code != "200" > >-- >Alex > might as well do this while you are at it... raise "url #{url} unreachable on host #{@host}:#{@port} - code #{response.code}" unless response.code == '200' _Kevin www.sciwerks.com -- Posted with http://DevLists.com. Sign up and save your mailbox.