       ]
     (error, results) ->
       if error?
-        if error.message? and error.message.match 'The conditional request failed'
+        if error.Body? and error.Body.message.match 'The conditional request failed'
           callback?('Document already exists')
         else if results? and results.write_metadata?
           console.error('Failed to save Snapshot('+docName+'-'+docData.v+') to S3: '+util.inspect(error))

        # TODO: This will only return the latest 1 MB of results, so if there
        # are more keys additional requests must be made.
        operations_ro_queue.push((c) ->
          db.query(request, c)
        , 'query Operations('+docName+')', cb)

      delete_snapshots: ['list_snapshots', (cb, results) ->
        return cb('Document does not exist', null) if results.list_snapshots.Count == 0

        async.mapSeries(results.list_snapshots.Items,
          (item, cb) ->
            request =
              TableName: snapshots_table

          ConsistentRead: true

        snapshots_ro_queue.push((c) ->
          db.Query(request, c)
        , 'query Snapshot('+docName+')', cb)

      get_data: ['get_snapshot', (cb, results) ->
        return cb('Document does not exist', null) unless results.get_snapshot.Body.Count == 1

        item = results.get_snapshot.Body.Items[0]
        params =
          BucketName: snapshots_bucket
          ObjectName: item.doc.S+'-'+item.v.N+'.snapshot'
