Commit 4cdde180 by mingyuan

rescue err

parent ae2b3abd
...@@ -38,7 +38,8 @@ module Dingtalk::Api ...@@ -38,7 +38,8 @@ module Dingtalk::Api
def with_access_token(params = {}, tries = 2) def with_access_token(params = {}, tries = 2)
app.refresh_access_token unless app.access_token_valid? app.refresh_access_token unless app.access_token_valid?
yield params.merge!(access_token: app.access_token) yield params.merge!(access_token: app.access_token)
rescue Wechat::AccessTokenExpiredError rescue => e
logger.debug e.backtrace
app.refresh_access_token app.refresh_access_token
retry unless (tries -= 1).zero? retry unless (tries -= 1).zero?
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment