Skip to content
This repository has been archived by the owner on Jan 24, 2021. It is now read-only.

Commit

Permalink
Revert "add constructor to DefaultStatusCodeHandlerResult, so we do n…
Browse files Browse the repository at this point in the history
…ot have to use initializer"

This reverts commit 7a050c0.
  • Loading branch information
bespokebob committed Apr 27, 2018
1 parent b7b20aa commit cbcf05c
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/Nancy/ErrorHandling/DefaultStatusCodeHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,13 @@ public void Handle(HttpStatusCode statusCode, NancyContext context)
? DisplayErrorTracesFalseMessage
: string.Concat("<pre>", context.GetExceptionDetails().Replace("<", "&gt;").Replace(">", "&lt;"), "</pre>");

var result = new DefaultStatusCodeHandlerResult(statusCode, this.errorMessages[statusCode], details);
var result = new DefaultStatusCodeHandlerResult
{
Details = details,
Message = this.errorMessages[statusCode],
StatusCode = statusCode
};

try
{
context.Response = this.responseNegotiator.NegotiateResponse(result, context);
Expand Down Expand Up @@ -154,18 +160,11 @@ private static string LoadResource(string filename)

internal class DefaultStatusCodeHandlerResult
{
public DefaultStatusCodeHandlerResult(HttpStatusCode statusCode, string message, string details)
{
this.StatusCode = statusCode;
this.Message = message;
this.Details = details;
}

public HttpStatusCode StatusCode { get; private set; }
public HttpStatusCode StatusCode { get; set; }

public string Message { get; private set; }
public string Message { get; set; }

public string Details { get; private set; }
public string Details { get; set; }
}
}
}

0 comments on commit cbcf05c

Please sign in to comment.