0

我的 ruby​​ 代码运行正常,但现在我发现抛出了随机异常。我追查了一下,这似乎是一个 FB 错误。往下看。如果我在创建页面帖子时为链接参数提供了有效的 URL,则会出现异常。如果我将其更改为其他随机的东西,那就没关系了。然后经过几次其他尝试,如果我回来尝试相同的 URL,这次就可以了。

--

[26] pry(FB::Post)> attrs[:link] = 'http://www.groupon.com/deals/new-health-centers'
=> "http://www.groupon.com/deals/new-health-centers"

[27] pry(FB::Post)> graph_post.put_connections(FB.config.page_id, 'feed', attrs)
Koala::Facebook::ClientError: type: OAuthException, code: 1500, message: (#1500) The url you supplied is invalid [HTTP 400]
from /Users/wedeng/.rvm/gems/ruby-1.9.3-p385/gems/koala-1.6.0/lib/koala/api/graph_api.rb:470:in `block in graph_call'

[30] pry(FB::Post)> attrs[:link] = 'http://www.groupon.com/dealx/newshealthscentersxxxxxxxxxxxxxxxxxxxxxxxxxx'
=> "http://www.groupon.com/dealx/newshealthscentersxxxxxxxxxxxxxxxxxxxxxxxxxx"

[31] pry(FB::Post)> graph_post.put_connections(FB.config.page_id, 'feed', attrs)
=> {"id"=>"60004615820_10151782223830821"}
4

0 回答 0