         error.stdout = stdout
         error.stderr = stderr
         callback(error)
+
+    handleProcessErrors(apmProcess, 'Fetching outdated packages and themes failed.', callback)
 
   loadPackage: (packageName, callback) ->
     args = ['view', packageName, '--json']
 
-    @runCommand args, (code, stdout, stderr) ->
+    apmProcess = @runCommand args, (code, stdout, stderr) ->
       if code is 0
         try
           packages = JSON.parse(stdout) ? []

    args.push('--themes') if loadThemes
    args.push('--compatible', version) if semver.valid(version)

    @runCommand args, (code, stdout, stderr) ->
      if code is 0
        try
          packages = JSON.parse(stdout) ? []

  checkNativeBuildTools: ->
    deferred = Q.defer()

    apmProcess = @runCommand ['install', '--check'], (code, stdout, stderr) =>
      if code is 0
        deferred.resolve()
      else
        deferred.reject(new Error())

    apmProcess.onWillThrowError ({error, handle}) ->
        handle()
        deferred.reject(error)

    deferred.promise

