Skip to content
Browse files

Use an authenticated call for gw.getVersion so we can verify that XML…

…-RPC is enabled and verify credentials.
  • Loading branch information...
1 parent 92c7de1 commit 0c5523a74afd020690335fe7e032f1ff3c415615 @scottgonzalez committed May 14, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 tasks/wordpress.js
View
4 tasks/wordpress.js
@@ -42,14 +42,16 @@ grunt.registerHelper( "wordpress-client", function() {
grunt.registerHelper( "wordpress-validate-xmlrpc-version", function( fn ) {
var client = grunt.helper( "wordpress-client" );
grunt.verbose.write( "Verifying XML-RPC version..." );
- client.call( "gw.getVersion", function( error, xmlrpcVersion ) {
+ client.authenticatedCall( "gw.getVersion", function( error, xmlrpcVersion ) {
if ( error ) {
grunt.verbose.error();
if ( error.code === -32601 ) {
return fn( new Error(
"XML-RPC extensions for grunt-wordpress are not installed." ) );
}
+ // XML-RPC is disabled or bad credentials
+ // WordPress provides good error messages, so we don't do any special handling
return fn( error );
}

0 comments on commit 0c5523a

Please sign in to comment.
Something went wrong with that request. Please try again.