How do I handle a 404 error from the open method in OpenURI

I was wondering if someone could quickly help me out with how i would go about handling a 404 error on a page i try and use the open method on.

begin   open(some_url) rescue   something_went_wrong end

hrm, i only asked here because i tried that and it didnt work :(. i'll give it another look maybe something else is amiss., Thanks