コード例 #1
0
        /// <inheritdoc/>
        public override ProblemDetails CreateProblemDetails(
            IOwinContext httpContext,
            int?statusCode  = null,
            string?title    = null,
            string?type     = null,
            string?detail   = null,
            string?instance = null
            )
        {
            statusCode ??= 500;

            var problemDetails = new ProblemDetails {
                Status   = statusCode,
                Title    = title,
                Type     = type,
                Detail   = detail,
                Instance = instance,
            };

            ApplyProblemDetailsDefaults(httpContext, problemDetails, statusCode.Value);

            return(problemDetails);
        }
コード例 #2
0
 private static void AddCustomProperties(IntelligentPlant.ProblemDetails.ProblemDetails problemDetails)
 {
     problemDetails.Extensions["request-id"] = "some-id";
     problemDetails.Extensions["utc-time"]   = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ");
 }