gaqzi / gocd-cli

A command line interface for common Go tasks
MIT License
24 stars 8 forks source link

Fix KeyError 'result' #15

Open sushengloong opened 8 years ago

sushengloong commented 8 years ago

There is a specific point of time where Go server API does not return 'result' for stage object in JSON response body. See https://github.com/gocd/gocd/blob/master/server/webapp/WEB-INF/rails.new/app/models/stage_instance_api_model.rb#L26 In order to prevent KeyError, we should use .get() instead of [] to read 'result' from the stage dictionary.

cc: @chuajiesheng