lib/addMethod/addMethodREST.js
function afterHeadersReject (error, payload, response) {

			logger.info(methodName+': running `afterHeaders` hook');
			globalize.afterHeaders.call(threadneedle, config, error, payload, params, response)

			.done(
				function (headers) {
					reject(formatResponse(headers, error));
				},
				function (err) {
					reject(formatResponse({}, err || error));
				}
			);

		}
function afterHeadersReject (error, payload, response) {

			logger.info(methodName+': running `afterHeaders` hook');
			globalize.afterHeaders.call(threadneedle, config, error, payload, params, response)

			.done(
				function (headers) {
					reject(formatResponse(headers, error));
				},
				function (err) {
					reject(formatResponse({}, err || error));
				}
			);

		}
function afterHeadersReject ( error , payload , response ) { logger . info ( methodName + ': running `afterHeaders` hook' ) ; globalize . afterHeaders . call ( threadneedle , config , error , payload , params , response ) . done ( function ( headers ) { reject ( formatResponse ( headers , error ) ) ; } , function ( err ) { reject ( formatResponse ( { } , err || error ) ) ; } ) ; }
Handle afterHeader for rejecting
Handle afterHeader for rejecting