cjfields / Bio-Tools-Primer3Redux

A reimplementation of BioPerl's Primer3-related code for primer3 v1 and v2
http://bioperl.org
10 stars 5 forks source link

Adding methods "errors" and "warnings" #7

Closed fschwach closed 13 years ago

fschwach commented 13 years ago

I came across a problem when the module returned no primers but this was acutally due to incorrect input parameters. I think it shouldbe made easier to check the Primer3Redux::Result object for errors and warning emsages with two shortcut methods that access run_parameter('PRIMER_WARNING') and run_parameter('PRIMERERROR') and return arrays. I think it should be suggested to always check for such errors before retrieving any information from a result object. I have added methods "errors" and "warnings", which makes it possible to do: die "this went wrong" if $results->errors; or: print "these warnings were returned by primer3\n"; print '- '.$."\n" for $results->warnings;

cjfields commented 13 years ago

Had a few smallish conflicts (easily resolved). I'll go ahead and push out another release to CPAN.