当调用这里提到的 highcharts-convert.js 时,我注意到即使输入的 json 无效,它也会返回成功代码 0。例如:
karl$ phantomjs ./app/javascript/highcharts-convert.js -infile ./spec/fixtures/invalid_input.json -outfile /var/folders/q2/m5hn1wq54zg33s7jv31d1p280000gq/T/hello.82829.54862.png -width 300
SyntaxError: Parse error
ReferenceError: Can't find variable: options
phantomjs://webpage.evaluate():57
phantomjs://webpage.evaluate():99
phantomjs://webpage.evaluate():99
loading images...
loading images...
loading images...
loading images...
loading images...
loading images...
loading images...
loading images...
loading images...
loading images...
loading images...
loading images...
loading images...
loading images...
loading images...
loading images...
loading images...
loading images...
loading images...
loading images...
loading images...
loading images...
loading images...
loading images...
loading images...
loading images...
loading images...
loading images...
loading images...
karl$ echo $?
0
如果没有正确的错误代码,在我看来,我的工作无法知道命令失败。我错过了什么吗?
谢谢。
-卡尔