Throw exception on curl exec error