func (f *FailureResponse) LoggerAction() string {
	return f.loggerAction
}
LoggerAction returns the loggerAction, used as the action when logging
package apiresponses
import (
	"fmt"
	"net/http"
	"code.cloudfoundry.org/lager"
)
type FailureResponse struct {
	error
	statusCode    int
	loggerAction  string
	emptyResponse bool
	errorKey      string
}
func NewFailureResponse(err error, statusCode int, loggerAction string) *FailureResponse {
	return &FailureResponse{
		error:        err,
		statusCode:   statusCode,
		loggerAction: loggerAction,
	}
}
func (f *FailureResponse) ErrorResponse() interface{} {
	if f.emptyResponse {
		return EmptyResponse{}
	}
	return ErrorResponse{
		Description: f.error.Error(),
		Error:       f.errorKey,
	}
}
func (f *FailureResponse) ValidatedStatusCode(logger lager.Logger) int {
	if f.statusCode < 400 || 600 <= f.statusCode {
		if logger != nil {
			logger.Error("validating-status-code", fmt.Errorf("Invalid failure http response code: 600, expected 4xx or 5xx, returning internal server error: 500."))
		}
		return http.StatusInternalServerError
	}
	return f.statusCode
}