     upsert: true,
     safe: true
   , (err, doc) ->
-    ifSuccessful err, callback, ->
-      callback()
+    if err?
+      promise.fail(err)
+    else
+      promise.keep('member', doc)
 
 module.exports = (jobs, db) ->
   jobs.process 'import members', (job, callback) ->

helpers = require '../util/helpers'
ifSuccessful = helpers.ifSuccessful

soap = require 'soap'
MongoClient = require('mongodb').MongoClient
mongoUrl = "mongodb://127.0.0.1:27017/galegis-api-dev"

membersSvcUri = "./wsdl/Members.svc.xml"

# Data returned by node-soap that was nil in the output is represented

            SessionId: session.assemblyId

          client.MemberService.BasicHttpBinding_MemberFinder.GetMembersBySession getMembersArgs, (err, result, raw) -> ifSuccessful err, callback, ->
            members = result.GetMembersBySessionResult.MemberListing

            promises = members.map (member) ->
              await('member').run (promise) ->
                persistMember(session, member, db, promise)

            await.all(promises).onkeep((got) -> callback()).onfail(() -> callback([].slice.call(arguments).join('\n')))
