function Sites( api ) {
	this.api = api;
}

Sites.prototype.query = function( args ) {
	return new Promise( ( resolve, reject ) => {
		this.api
			.get( '/sites' )
			.query( args )
			.end( ( err, res ) => {
				if ( err ) {
					return reject( err.response.body );
				}

				return resolve( res.body );
			});
	});
}

module.exports = Sites;

function Sites( api ) {
	this.api = api;
}

Sites.prototype.query = function( args ) {
	return new Promise( ( resolve, reject ) => {
		this.api
			.get( '/sites' )
			.query( args )
			.end( ( err, res ) => {
				if ( err ) {
					return reject( err );
				}

				return resolve( res.body );
			});
	});
}

module.exports = Sites;

Return full error object when a request fails
Return full error object when a request fails

We're not guaranteed to get an error response, so we have to return the
full error object.
