modify upstream state detection to provide more detailed output and catch error when last build or result is not available (#132)