Closed exercism-1 closed 6 years ago
tick warns on error instead of dying, which doesn't match the documentation.
tick
https://metacpan.org/pod/WWW::Mechanize#$mech-%3Etick(-$name,-$value-%5B,-$set%5D-):
Dies if there is no named check box for that value.
https://metacpan.org/source/OALDERS/WWW-Mechanize-1.86/lib/WWW/Mechanize.pm#L885-886:
# got self far? Didn't find anything $self->warn( qq{No checkbox "$name" for value "$value" in form} );
That means code like:
eval { $mech->tick($field, $value); } if ($@) { ... }
doesn't actually detect errors (tick never dies) and spews warnings (because eval only catches exceptions, not warnings).
eval
Sounds like we need to have the code align with the docs. @genio thoughts?
@petdance any thoughts on how to handle this?
Seems to me the warn should be a die, because the warning isn't very useful.
tick
warns on error instead of dying, which doesn't match the documentation.https://metacpan.org/pod/WWW::Mechanize#$mech-%3Etick(-$name,-$value-%5B,-$set%5D-):
https://metacpan.org/source/OALDERS/WWW-Mechanize-1.86/lib/WWW/Mechanize.pm#L885-886:
That means code like:
doesn't actually detect errors (
tick
never dies) and spews warnings (becauseeval
only catches exceptions, not warnings).