-
Notifications
You must be signed in to change notification settings - Fork 191
Closed
Description
When a request 404s superagent will say "Error: Not Found", and isn't kind enough to tell us what it didn't find... In our applications we have had to copy/paste node-wpapi's own transport API to add logging that tells us the URL of a request before it dispatches.
Ideally this could be option within the library itself, e.g. debug option that defaults to false and is picked up in transport methods like this:
function _httpGet( wpreq, callback, debug ) {
if ( debug ) {
console.log( '[node-wpapi] GET ' + wpreq.toString() );
}
checkMethodSupport( 'get', wpreq );
// ...
}
Are you happy for me to put in a PR for this?
Metadata
Metadata
Assignees
Labels
No labels