fixed rescue for ruby 1.8

This commit is contained in:
404
2012-09-03 18:10:58 +08:00
parent 7b628281d3
commit 13e1051b87
2 changed files with 9 additions and 3 deletions
+7 -1
View File
@@ -70,7 +70,13 @@ module Qiniu
else
code, data = Auth.call_with_signature(url, data, 0, options)
end
rescue [MissingAccessToken, MissingRefreshToken, MissingUsernameOrPassword] => e
rescue MissingAccessToken => e
Log.logger.error e
code, data = 401, {}
rescue MissingRefreshToken => e
Log.logger.error e
code, data = 401, {}
rescue MissingUsernameOrPassword => e
Log.logger.error e
code, data = 401, {}
end
+2 -2
View File
@@ -6,8 +6,8 @@ require 'rspec'
RSpec.configure do |config|
config.before :all do
Qiniu::RS.establish_connection! :access_key => "bE21M6FW9V7zAFrBY5psgKOKJQLiBj12qMWTpc57",
:secret_key => "uMo7Nyq_eDK_CuQ8_FYCxoTHQZqjiaPh-cbiKO7L",
Qiniu::RS.establish_connection! :access_key => "dFX_wMGVrRzwdWaraW-Qe5ZCDT-kcSmIAGKQOkXh",
:secret_key => "VllxxDfkn_h2ZIqeKYTnHJiN4LVODfDBlJHy_KsW",
:auth_url => "http://m1.qbox.me:13001/oauth2/token",
:rs_host => "http://m1.qbox.me:13003",
:io_host => "http://m1.qbox.me:13004",