Subject: | Add automatic success check |
Hi,
it would be very handy if Mechanize would have a "check" option (like the quiet option). Something like adding "die 'operation was not successful' if $self->{check} && !$self->success" just before returning to the invoker.
Dreaming on, it would be even nicer if I could register a callback function
which would be called whenever a request failed and registering 'undef' as the callback would switch the check option off. A default callback could e.g. just die with a nice warning.
I even think that having "die" as the default method would make sense (given the fact that the FAQ states you have to do this anyway). If someone does not want this new behavior, she could just issue a "$mech->check(undef)".
What do you think? I might even try to submit a patch if you like this idea...
so long
Norbert