server/images: fix processing errors
This commit is contained in:
parent
4dcee37567
commit
6bff0a6a26
2 changed files with 4 additions and 3 deletions
|
@ -40,7 +40,7 @@ def _on_not_found_error(ex, _request, _response, _params):
|
|||
raise falcon.HTTPNotFound(title='Not found', description=str(ex))
|
||||
|
||||
def _on_processing_error(ex, _request, _response, _params):
|
||||
raise falcon.HTTPNotFound(title='Processing error', description=str(ex))
|
||||
raise falcon.HTTPBadRequest(title='Processing error', description=str(ex))
|
||||
|
||||
def create_app():
|
||||
''' Create a WSGI compatible App object. '''
|
||||
|
|
|
@ -38,11 +38,12 @@ class Image(object):
|
|||
|
||||
def _execute(self, cli):
|
||||
proc = subprocess.Popen(
|
||||
['ffmpeg'] + cli,
|
||||
['ffmpeg', '-loglevel', '24'] + cli,
|
||||
stdout=subprocess.PIPE,
|
||||
stdin=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
out, err = proc.communicate(input=self.content)
|
||||
if proc.returncode != 0:
|
||||
raise errors.ConversionError(err)
|
||||
raise errors.ProcessingError(
|
||||
'Error while processing image.\n' + err.decode('utf-8'))
|
||||
return out
|
||||
|
|
Loading…
Reference in a new issue