Headless.HttpOutcomeException.GenerateFailureMessage C# (CSharp) Méthode

GenerateFailureMessage() private static méthode

Generates the failure message.
/// The parameter is null. /// /// The parameter is null. ///
private static GenerateFailureMessage ( HttpResult result, Exception inner ) : string
result HttpResult The result.
inner System.Exception The inner.
Résultat string
        private static string GenerateFailureMessage(HttpResult result, Exception inner)
        {
            if (result == null)
            {
                throw new ArgumentNullException("result");
            }

            if (inner == null)
            {
                throw new ArgumentNullException("inner");
            }

            var lastOutcome = result.Outcomes.Last();

            var outcomes = result.Outcomes.Aggregate(string.Empty, (x, y) => x + Environment.NewLine + y);

            // We have been requested to go to a location that doesn't match the requested page
            var message = string.Format(
                CultureInfo.CurrentCulture,
                "The {0} request to {1} has failed with the message '{2}'. The responses for this request were: {3}",
                lastOutcome.Method,
                lastOutcome.Location,
                inner.Message,
                outcomes);

            return message;
        }