when it is an IOError or an OSError - return a normal error message instead of a traceback barf
This commit is contained in:
parent
85f751175d
commit
39f42cfd75
1 changed files with 6 additions and 0 deletions
|
@ -17,6 +17,12 @@ try:
|
||||||
cmd = subprocess.Popen(args, shell=False,
|
cmd = subprocess.Popen(args, shell=False,
|
||||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
out, err = cmd.communicate()
|
out, err = cmd.communicate()
|
||||||
|
except (OSError, IOError), e:
|
||||||
|
print json.dumps({
|
||||||
|
"failed": 1,
|
||||||
|
"error": str(e),
|
||||||
|
})
|
||||||
|
sys.exit(1)
|
||||||
except:
|
except:
|
||||||
print json.dumps({
|
print json.dumps({
|
||||||
"failed" : 1,
|
"failed" : 1,
|
||||||
|
|
Loading…
Reference in a new issue