Getting this message:⬇

GoogleDrive::Error (Response code 500 for post 
https://spreadsheets.google.com/feeds/cells/.../od6/private/full/batch: 
<!DOCTYPE html><html lang="ja" ><head><meta name="description" content="ウェブ 
ワープロ、プレゼンテーション、スプレッドシート"><link rel="shortcut icon" 
href="//ssl.gstatic.com/docs/common/drive_favicon1.ico"><title>Google 
ドライブのエラー</title><link href="//fonts.googleapis.com/css?family=Open+Sans:300" 
rel="stylesheet" type="text/css"><style>/* Copyright 2014 Google Inc. All 
Rights Reserved. */
.goog-inline-block{position:relative;display:-moz-inline-box;display:inline-block}*
 html .goog-inline-block{display:inline}*:first-child+html 
.goog-inline-block{display:inline}#drive-logo{color:#91959c;font-family:"Open 
Sans",Arial,sans-serif;font-size:27px;font-weight:300;position:absolute;text-shadow:0
 1px 1px white;white-space:nowrap}#drive-logo img{padding:0 0.4em 0 
0;position:relative;top:2px;vertical-align:middle}#drive-logo 
a{color:#91959c;text-decoration:none}#drive-logo 
span.goog-inline-block{margin-top:2px;vertical-align:top}</style><style 
type="text/css">body {background-color: #fff; font-family: Arial,sans-serif; 
font-size: 13px; margin: 0; padding: 0;}a, a:link, a:visited {color: 
#112ABB;}</style><style type="text/css">.errorMessage {font-size: 12pt; 
font-weight: bold; line-height: 150%;}</style></head><body><div style="margin: 
auto; max-width: 750px;"><div style="margin: 80px 40px 20px 40px; 
position:relative; "><div style="position: absolute; top: -80px;"><h1 
id="drive-logo"><a href="/"><img 
src="//www.google.com/images/logos/google_logo_41.png" width="116" height="41" 
alt="Google logo" ><span class="goog-inline-block">ドライブ</span></a></h1></div><p 
style="padding-top: 15px">Google ドライブでエラーが発生しました。ページを再読み込みしても解決しない場合は、<a 
href="http://support.google.com/drive/bin/request.py?hl=ja_JP&ctx=docs&contact_type=server_error";
 target="_blank">エラーを報告</a>してください。</p><p>サーバー 
エラーが発生しました。しばらくしてからスプレッドシートをリロードしてください。<br>Google ドライブの詳細については、<a 
href="http://support.google.com/drive/?hl=ja_JP&p=error_help"; 
target="_blank">ヘルプセンター</a>をご覧ください。</p><p><br><b>ご迷惑をおかけして申し訳ありません。ご協力ありがとうございます。</b><br><i>-
 Google ドライブ チーム</i></p></div></div></body></html>):
  app/controllers/items_controller.rb:163:in `block in google_report'
  app/controllers/items_controller.rb:144:in `google_report'


Using this code:⬇

def report
   session = GoogleDrive.login(current_user.gmail, 
ActiveSupport::MessageEncryptor.new(SECRET).decrypt(current_user.gmail_pass))
    session.create_spreadsheet("All items (" + params[:d_from] + " 〜 " + 
params[:d_till] + ")")
    ws = session.spreadsheet_by_title("All items (" + params[:d_from] + " 〜 " + 
params[:d_till] + ")").worksheets[0]
    ws[1, 1] = "商品名"
    ws[1, 2] = "ASIN"
    ws[1, 3] = "期間"
...

    @i_all = Item.all
    @i_all.try(:each_with_index) do |i, index|
puts "index =>" + index.to_s
      @i_detail = Item.find(i.min_id)
      ws[index+2, 1] = @i_detail.title
      ws[index+2, 2] = @i_detail.asin
      ws[index+2, 3] = params[:d_from] + " 〜 " + params[:d_till]
....

      ws.save()
    end
    ws.save()
end

How to catch and do a retry?

-- 
You received this message because you are subscribed to the Google Groups 
"Google Spreadsheets API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to