環境対応 #536 » a.patch
connect.rb (作業コピー) | ||
---|---|---|
53 | 53 |
case res.code |
54 | 54 |
when '200' |
55 | 55 |
when '400' |
56 |
if res.is_a? Net::HTTPBadRequest |
|
57 |
begin |
|
58 |
error_message = (JSON.parse(res.body)["errors"][0]["message"] rescue nil) |
|
59 | ||
60 |
if error_message == "Bad Authentication data" |
|
61 |
atoken = authentication_failed_action(method, url, options, res) |
|
62 |
notice atoken |
|
63 |
return query_with_oauth!(method, url, options) if atoken |
|
64 |
end |
|
65 | ||
66 |
notice error_message |
|
67 |
rescue JSON::ParserError |
|
68 |
end |
|
69 |
end |
|
70 | ||
56 | 71 |
fire_oauth_limit_event |
57 | 72 |
when '401' |
58 | 73 |
begin |