Skip to content

Commit

Permalink
Merge pull request #260 from mozilla/bug-1087997-ingestion-failure
Browse files Browse the repository at this point in the history
Bug 1087997 - better handling of failures on data ingestion
  • Loading branch information
camd committed Oct 27, 2014
2 parents 8b995f9 + 91aaffe commit ad3f46f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions treeherder/etl/mixins.py
Expand Up @@ -116,7 +116,6 @@ def load(self, result_sets, project):
class OAuthLoaderMixin(object):

def load(self, th_collections):

for project in th_collections:

credentials = OAuthCredentials.get_credentials(project)
Expand All @@ -129,11 +128,12 @@ def load(self, th_collections):
oauth_secret=credentials.get('consumer_secret', None)
)

logger.info("collection loading request: {0}".format(th_request.get_uri(th_collections[project].endpoint_base)))
logger.info(
"collection loading request: {0}".format(
th_request.get_uri(th_collections[project].endpoint_base)))
response = th_request.post(th_collections[project])

if not response or response.status != 200:
message = response.read()
raise Exception('collection loading failed: {0}'.format(message))


logger.error('[{0}]Error posting data to {1} : {2}'.format(
project, th_collections[project].endpoint_base, message))

0 comments on commit ad3f46f

Please sign in to comment.