in reply to
Re^3: WWW::Mechanize - error on geting non-existing page
in thread WWW::Mechanize - error on geting non-existing page
Öwell, all examples really. Though it depends on how you see it. I never advocated ignoring return states.
Not finding a page online is not an exception(al case). Itís entirely normal. Should your car blow-up if a road-sign is missing or should the driver revisit the map? If you need to deal with any of the various 400s and 500s, itís just easier on the hacker to not wrap it up in evals. The end code will have identical functionality: i.e., every request is checked for success or unexpected codes and then processed accordingly. All the exception handling buys you here is additional complexity (and the chance to fall into eval problems with disappearing $@ if youíre not careful).
The change to make this stuff fatal by default is recent-ish. For most of the life of Mech, it wasnít this way so it was a pretty big style break for those of us using it from the beginning, and I think most LWP hackers are already accustomed to checking $response->is_success habitually.
There may be some value in the fatals for the newcomer who has incorrect expectations but for the experienced user of the kit itís just an annoying hoop (and a bunch of broken scripts when the update came through but I digressÖ uh, and whine).