             console.log "Fetching pack: #{packName}"
             context.requestPack packName, (error, flowNames) ->
               if error
-                console.log 'Failed fetching pack'
+                console.log '*** ERROR *** Failed fetching pack'
                 go error
               else
                 console.log 'Processing pack...'

            console.log 'Fetching packs...'
            context.requestPacks (error, packNames) ->
              if error
                console.log 'Failed fetching packs'
                go error
              else
                console.log 'Processing packs...'

          window._phantom_started_ = yes
          runPacks (error) ->
            if error
              console.log '*** ERROR *** Error running packs: ' + JSON.stringify error
            else
              console.log 'Finished running all packs!'
            window._phantom_exit_ = yes
          no

    waitFor test, ->
      errors = page.evaluate -> window._phantom_errors_
      if errors
        console.log 'PHANTOM: *** ERROR *** One or more flows failed to complete: ' + JSON.stringify errors
        phantom.exit 1
      else
        console.log 'PHANTOM: Success! All flows ran to completion!'
        phantom.exit 0
  else
    console.log 'PHANTOM: *** ERROR *** Unable to access network.'
    phantom.exit 1


