cells: log level error if error in url (jsoncell) (#56979)
gitea-wip/combo/pipeline/head There was a failure building this commit Details
gitea/combo/pipeline/head Build started... Details

This commit is contained in:
Lauréline Guérin 2021-09-17 14:19:55 +02:00
parent bee691aa15
commit 4262533fec
No known key found for this signature in database
GPG Key ID: 1FAB9B9B4F93D473
1 changed files with 4 additions and 1 deletions

View File

@ -1852,7 +1852,10 @@ class JsonCellBase(CellBase):
url = utils.get_templated_url(data_url_dict['url'], context)
except utils.TemplateError as e:
logger = logging.getLogger(__name__)
logger.warning('error in templated URL (%s): %s', data_url_dict['url'], e)
if log_errors:
logger.error('error in templated URL (%s): %s', data_url_dict['url'], e)
else:
logger.debug('error in templated URL (%s): %s', data_url_dict['url'], e)
continue
extra_context[data_key + '_url'] = url
if not url: