more detailed error logging for google docs linking issue
In some cases, google docs api is returning an xml document that our api doesn't know how to handle. More info is needed in order to assess and fix the issue. Refs CNVS-3012 Change-Id: Ia78047872e054204cc32d2b5ae42adc830b80942 Reviewed-on: https://gerrit.instructure.com/16996 Tested-by: Jenkins <jenkins@instructure.com> Reviewed-by: Brian Palmer <brianp@instructure.com> QA-Review: Brian Palmer <brianp@instructure.com>
This commit is contained in:
parent
f519ae1fae
commit
22e3992dd3
|
@ -223,8 +223,19 @@ module GoogleDocs
|
|||
category.label = "document"
|
||||
end
|
||||
end
|
||||
response = access_token.post(url, entry.to_xml, {'Content-Type' => 'application/atom+xml'})
|
||||
entry = GoogleDocEntry.new(Atom::Entry.load_entry(response.body))
|
||||
xml = entry.to_xml
|
||||
begin
|
||||
response = access_token.post(url, xml, {'Content-Type' => 'application/atom+xml'})
|
||||
rescue => e
|
||||
raise "Unable to post to Google API #{url}:\n#{xml}" +
|
||||
"\n\n(" + e.to_s + ")\n"
|
||||
end
|
||||
begin
|
||||
entry = GoogleDocEntry.new(Atom::Entry.load_entry(response.body))
|
||||
rescue => e
|
||||
raise "Unable to load GoogleDocEntry from response: \n" + response.body +
|
||||
"\n\n(" + e.to_s + ")\n"
|
||||
end
|
||||
end
|
||||
|
||||
def google_docs_delete_doc(entry, access_token = google_docs_retrieve_access_token)
|
||||
|
|
Loading…
Reference in New Issue