         try
           packages = JSON.parse(stdout) ? []
           deferred.resolve(packages)
-        catch error
+        catch parseError
+          error = createJsonParseError("Searching for \u201C#{query}\u201D failed.", parseError, stdout)
           deferred.reject(error)
       else
         error = new Error("Searching for \u201C#{query}\u201D failed.")

    theme = pack.theme ? pack.metadata?.theme
    eventName = if theme then "theme-#{eventName}" else "package-#{eventName}"
    @emit eventName, pack, error

      if code is 0
        try
          packages = JSON.parse(stdout) ? []
        catch parseError
          error = createJsonParseError('Fetching featured packages failed.', parseError, stdout)
          return callback(error)

        callback(null, packages)
      else
