DavidAnson / check-pages

Checks various aspects of a web page for correctness.
MIT License
11 stars 6 forks source link

Node-Errors. #6

Closed lukasoppermann closed 8 years ago

lukasoppermann commented 8 years ago

Hey,

it generally works, but I get this error, any idea why?

[13:25:48] Error: 57 issues.
    at /Users/lukasoppermann/Code/formandsystem-cms/node_modules/check-pages/checkPages.js:426:13
    at next (/Users/lukasoppermann/Code/formandsystem-cms/node_modules/check-pages/checkPages.js:435:5)
    at /Users/lukasoppermann/Code/formandsystem-cms/node_modules/check-pages/checkPages.js:119:18
    at next (/Users/lukasoppermann/Code/formandsystem-cms/node_modules/check-pages/checkPages.js:435:5)
    at /Users/lukasoppermann/Code/formandsystem-cms/node_modules/check-pages/checkPages.js:119:18
    at next (/Users/lukasoppermann/Code/formandsystem-cms/node_modules/check-pages/checkPages.js:435:5)
    at /Users/lukasoppermann/Code/formandsystem-cms/node_modules/check-pages/checkPages.js:119:18
    at next (/Users/lukasoppermann/Code/formandsystem-cms/node_modules/check-pages/checkPages.js:435:5)
    at Request._callback (/Users/lukasoppermann/Code/formandsystem-cms/node_modules/check-pages/checkPages.js:314:9)
    at Request.self.callback (/Users/lukasoppermann/Code/formandsystem-cms/node_modules/request/request.js:200:22)
DavidAnson commented 8 years ago

If errors are detected, check-pages calls the done callback (third parameter of the export) with an Error instance that has more details. You can console.log that object for more information. Along the way, the host object (first parameter of the export) will have its log or error methods called with each issue. You can set summary of the options object (second parameter of the export) to true to include all errors in the error object as well.

Here's a simple, stand-alone example you can run via node example.js after npm install check-pages:

var checkPages = require("check-pages");
checkPages(
  console,
  {
    pageUrls: ["http://google.com/"],
    checkLinks: true,
    checkXhtml: true
  },
  function(err, count) {
    if (err) {
      console.log("Error object: " + err);
    }
    console.log("Error count: " + count);
  }
);
lukasoppermann commented 8 years ago

Awesome, thanks.