log response data on non-200 responses in TUF API
This commit is contained in:
parent
ac328da383
commit
b545cad380
1 changed files with 3 additions and 3 deletions
|
@ -36,7 +36,7 @@ class Non200ResponseException(Exception):
|
|||
|
||||
|
||||
class TUFMetadataAPI(object):
|
||||
""" Helper class for talking to the Security Scan service (usually Clair). """
|
||||
""" Helper class for talking to the TUF Metadata service (Apostille). """
|
||||
def __init__(self, app, config, client=None):
|
||||
feature_enabled = config.get('FEATURE_SIGNING', False)
|
||||
if feature_enabled:
|
||||
|
@ -202,7 +202,7 @@ class ImplementedTUFMetadataAPI(TUFMetadataAPIInterface):
|
|||
logger.exception('Failed to delete metadata for %s', gun)
|
||||
return False
|
||||
except Non200ResponseException as ex:
|
||||
logger.exception('Failed request for %s: %s', gun, str(ex))
|
||||
logger.exception('Failed request for %s: %s %s', gun, ex.response, str(ex))
|
||||
return False
|
||||
return True
|
||||
|
||||
|
@ -223,7 +223,7 @@ class ImplementedTUFMetadataAPI(TUFMetadataAPIInterface):
|
|||
except (requests.exceptions.RequestException, ValueError):
|
||||
logger.exception('Failed to get metadata for %s', gun)
|
||||
except Non200ResponseException as ex:
|
||||
logger.exception('Failed request for %s: %s', gun, str(ex))
|
||||
logger.exception('Failed request for %s: %s %s', gun, ex.response, str(ex))
|
||||
except InvalidMetadataException as ex:
|
||||
logger.exception('Failed to parse targets from metadata: %s', str(ex))
|
||||
return None
|
||||
|
|
Reference in a new issue