       if file?.id
         metadata.overwritable = file.editable
         metadata.providerData = id: file.id
-        gapi.drive.realtime.load file.id, fileLoaded, init
+        gapi.drive.realtime.load file.id, fileLoaded, init, error
       else
         callback 'Unable to load file'
 

      content = model.createString ''
      model.getRoot().set 'content', content

    if metadata.providerData?.id
      request = gapi.client.drive.files.get
        fileId: metadata.providerData.id

      gapi.auth.authorize args, (authToken) =>
        @authToken = if authToken and not authToken.error then authToken else null
        @user = null
        @autoRenewToken @authToken
        if @authToken
          gapi.client.oauth2.userinfo.get().execute (user) =>
            @user = user
        @authCallback @authToken isnt null

  autoRenewToken: (authToken) ->
    if @_autoRenewTimeout
      clearTimeout @_autoRenewTimeout
    if authToken and not authToken.error
      @_autoRenewTimeout = setTimeout (=> @authorize GoogleDriveProvider.IMMEDIATE), (parseInt(authToken.expires_in, 10) * 0.75) * 1000

  renderAuthorizationDialog: ->
    (GoogleDriveAuthorizationDialog {provider: @})
