mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 20:59:01 +02:00
Fix output decoding/reporting for bulk change patch download
With Python 3 we need to take care of decoding the output so we can treat it as a string. At the same time, it's more useful to see the output string rather than the exception if there is some output. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
parent
ef00bf4df5
commit
81e3086f4c
|
@ -237,8 +237,11 @@ def bulk_change_patch_view(request, pk):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
output = getattr(e, 'output', None)
|
output = getattr(e, 'output', None)
|
||||||
if output:
|
if output:
|
||||||
|
output = output.decode('utf-8', errors="ignore")
|
||||||
if 'timeout' in output:
|
if 'timeout' in output:
|
||||||
return HttpResponse('Failed to generate patches: timed out waiting for lock. Please try again shortly.', content_type='text/plain')
|
return HttpResponse('Failed to generate patches: timed out waiting for lock. Please try again shortly.', content_type='text/plain')
|
||||||
|
else:
|
||||||
|
return HttpResponse('Failed to generate patches: %s' % output, content_type='text/plain')
|
||||||
return HttpResponse('Failed to generate patches: %s' % e, content_type='text/plain')
|
return HttpResponse('Failed to generate patches: %s' % e, content_type='text/plain')
|
||||||
# FIXME better error handling
|
# FIXME better error handling
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user