Catch IOErrors when starting builds
Fixes https://sentry.io/coreos/backend-production/issues/207144068/
This commit is contained in:
parent
d29d2da1ca
commit
3f1d394e14
1 changed files with 6 additions and 3 deletions
|
@ -276,9 +276,12 @@ class RepositoryBuildList(RepositoryParamResource):
|
|||
if repo is None:
|
||||
raise NotFound()
|
||||
|
||||
build_name = (user_files.get_file_checksum(dockerfile_id)
|
||||
if dockerfile_id
|
||||
else hashlib.sha224(archive_url).hexdigest()[0:7])
|
||||
try:
|
||||
build_name = (user_files.get_file_checksum(dockerfile_id)
|
||||
if dockerfile_id
|
||||
else hashlib.sha224(archive_url).hexdigest()[0:7])
|
||||
except IOError:
|
||||
raise InvalidRequest('File %s could not be found or is invalid' % dockerfile_id)
|
||||
|
||||
prepared = PreparedBuild()
|
||||
prepared.build_name = build_name
|
||||
|
|
Reference in a new issue