Skip to content

Commit

Permalink
Improve debugging messages
Browse files Browse the repository at this point in the history
  • Loading branch information
jdidion committed Aug 9, 2017
1 parent d8cee15 commit b78616a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changes

v1.1.10 (2017.08.09)
--------------------
* Improve debugging messages

v1.1.9 (2017.08.01)
-------------------
* Fix #30: failure when using --preserve-order option
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![Travis CI](https://travis-ci.org/jdidion/atropos.svg?branch=master)](https://travis-ci.org/jdidion/atropos])
[![PyPi](https://img.shields.io/pypi/v/atropos.svg?branch=master)](https://pypi.python.org/pypi/atropos)
[![PyPi](https://img.shields.io/pypi/v/atropos.svg)](https://pypi.python.org/pypi/atropos)
[![DOI](https://zenodo.org/badge/61393086.svg)](https://zenodo.org/badge/latestdoi/61393086)

# Atropos
Expand Down
11 changes: 8 additions & 3 deletions atropos/commands/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import copy
import platform
import sys
from atropos import __version__
from atropos import __version__, AtroposError
from atropos.adapters import AdapterCache
from atropos.io.seqio import open_reader, sra_reader
from atropos.util import MergingDict, Const, Summarizable, Timing
Expand Down Expand Up @@ -69,8 +69,13 @@ def handle_records(self, context, records):
context: The pipeline context (dict).
records: The sequence of records.
"""
for record in records:
self.handle_record(context, record)
for idx, record in enumerate(records):
try:
self.handle_record(context, record)
except Exception as err:
raise AtroposError(
"An error occurred at record {} of batch {}".format(
idx, context['index'])) from err

def handle_record(self, context, record):
"""Handle a single record.
Expand Down

0 comments on commit b78616a

Please sign in to comment.