Skip to content
This repository has been archived by the owner on Sep 23, 2023. It is now read-only.

Commit

Permalink
Merge pull request #620 from adamrp/tweak_metadata_script
Browse files Browse the repository at this point in the history
Remove exception
  • Loading branch information
ElDeveloper committed Feb 12, 2014
2 parents f8cc777 + 57cd94a commit 93858fd
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions python_code/scripts/ag_get_metadata.py
Expand Up @@ -56,11 +56,6 @@

script_info['version'] = __version__

class BarcodeError(Exception):
"""Error raised when there's a problem retrieving metadata for a barcode
"""
pass

def get_ag_metadata_bulk(barcodes):
"""Calls ag_get_barcode_metadata on a list of barcodes
Expand All @@ -75,10 +70,10 @@ def get_ag_metadata_bulk(barcodes):
bc = line.strip()
metadata = ag_data_access.AGGetBarcodeMetadata(bc)
if len(metadata) != 1:
raise BarcodeError("%d results were returned for barcode %s; "
"there should be exactly one result for any "
"single barcode" % (len(metadata), bc))
yield metadata[0]
print ("FAILED barcode %s; %d results were returned (should be 1)"
% (bc, len(metadata)))
else:
yield metadata[0]

def main():
option_parser, opts, args = parse_command_line_parameters(**script_info)
Expand Down

0 comments on commit 93858fd

Please sign in to comment.