From cc5db1777ad7334243dff0d9a0bbacea417b5ffb Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Fri, 29 May 2020 08:29:07 -0500 Subject: Improved error output for the web uploader --- bh20sequploader/qc_fasta.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'bh20sequploader/qc_fasta.py') diff --git a/bh20sequploader/qc_fasta.py b/bh20sequploader/qc_fasta.py index 16cf2c9..5c8cf3a 100644 --- a/bh20sequploader/qc_fasta.py +++ b/bh20sequploader/qc_fasta.py @@ -6,6 +6,8 @@ import tempfile import logging import re +log = logging.getLogger(__name__ ) + def read_fasta(sequence): entries = 0 bases = [] @@ -17,11 +19,12 @@ def read_fasta(sequence): else: bases.append(line) if entries > 1: + log.debug("FASTA file contains multiple entries") raise ValueError("FASTA file contains multiple entries") - break return label, bases def qc_fasta(sequence): + log.debug("Starting qc_fasta") schema_resource = pkg_resources.resource_stream(__name__, "validation/formats") with tempfile.NamedTemporaryFile() as tmp: tmp.write(schema_resource.read()) -- cgit v1.2.3