Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re^5: WWW::Mechanize - error on geting non-existing page

by Limbic~Region (Chancellor)
on Nov 09, 2011 at 17:06 UTC ( #937127=note: print w/ replies, xml ) Need Help??

in reply to Re^4: WWW::Mechanize - error on geting non-existing page
in thread WWW::Mechanize - error on geting non-existing page

Your Mother,
If instead of:

You can also just set onerror => undef which is easier and less error prone than eval/try style code.

You had said:

This behavior can be turned off by either setting onerror to undef or by turning autocheck off in the constructor. The purpose behind this was the author's attempt to protect new users from themselves. Just as you shouldn't assume that your call to open was successful, you shouldn't assume your call to get was either. It will be your responsibility to check each success for is_success/status and handle any recoverable situations yourself if you do this.

I would never have commented. Personally, I like having the code blow up to remind me of places I haven't properly checked the status and leave it on by default but I can see your point as well.

Cheers - L~R

Comment on Re^5: WWW::Mechanize - error on geting non-existing page

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://937127]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (16)
As of 2014-09-22 20:50 GMT
Find Nodes?
    Voting Booth?

    How do you remember the number of days in each month?

    Results (200 votes), past polls