Log details of one-off label printing error, when they occur
needed for troubleshooting
This commit is contained in:
parent
1d744d4c26
commit
5a96672d79
|
@ -27,6 +27,7 @@ Product Views
|
|||
from __future__ import unicode_literals, absolute_import
|
||||
|
||||
import re
|
||||
import logging
|
||||
|
||||
import six
|
||||
import sqlalchemy as sa
|
||||
|
@ -52,6 +53,9 @@ from tailbone.progress import SessionProgress
|
|||
from tailbone.util import raw_datetime
|
||||
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# TODO: For a moment I thought this was going to be necessary, but now I think
|
||||
# not. Leaving it around for a bit just in case...
|
||||
|
||||
|
@ -1169,6 +1173,7 @@ def print_labels(request):
|
|||
try:
|
||||
printer.print_labels([(product, quantity, {})])
|
||||
except Exception as error:
|
||||
log.warning("error occurred while printing labels", exc_info=True)
|
||||
return {'error': six.text_type(error)}
|
||||
return {}
|
||||
|
||||
|
|
Loading…
Reference in a new issue