Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

#nullable enable

using System;
using Microsoft.AspNetCore.Diagnostics;
using Microsoft.Extensions.Options;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

#nullable enable

using System;
using System.Collections.Generic;
using System.Diagnostics;
Expand Down Expand Up @@ -165,10 +163,7 @@ private Task DisplayCompilationException(
HttpContext context,
ICompilationException compilationException)
{
var model = new CompilationErrorPageModel
{
Options = _options,
};
var model = new CompilationErrorPageModel(_options);

var errorPage = new CompilationErrorPage
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

#nullable enable

using Microsoft.AspNetCore.Diagnostics;
using Microsoft.Extensions.FileProviders;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@ namespace Microsoft.AspNetCore.Diagnostics.RazorViews
/// </summary>
internal class CompilationErrorPageModel
{
public CompilationErrorPageModel(DeveloperExceptionPageOptions options)
{
Options = options;
}

/// <summary>
/// Options for what output to display.
/// </summary>
public DeveloperExceptionPageOptions Options { get; set; }
public DeveloperExceptionPageOptions Options { get; }

/// <summary>
/// Detailed information about each parse or compilation error.
Expand All @@ -25,6 +30,6 @@ internal class CompilationErrorPageModel
/// <summary>
/// Gets the generated content that produced the corresponding <see cref="ErrorDetails"/>.
/// </summary>
public IList<string> CompiledContent { get; } = new List<string>();
public IList<string?> CompiledContent { get; } = new List<string?>();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ namespace Microsoft.AspNetCore.Diagnostics.RazorViews
{
internal class EndpointModel
{
public string DisplayName { get; set; }
public string RoutePattern { get; set; }
public string? DisplayName { get; set; }
public string? RoutePattern { get; set; }
public int? Order { get; set; }
public string HttpMethods { get; set; }
public string? HttpMethods { get; set; }
}
}
6 changes: 3 additions & 3 deletions src/Middleware/Diagnostics/src/DiagnosticsLoggerExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ internal static class DiagnosticsLoggerExtensions
LoggerMessage.Define(LogLevel.Error, new EventId(1, "UnhandledException"), "An unhandled exception has occurred while executing the request.");

// ExceptionHandlerMiddleware
private static readonly Action<ILogger, Exception> _responseStartedErrorHandler =
private static readonly Action<ILogger, Exception?> _responseStartedErrorHandler =
LoggerMessage.Define(LogLevel.Warning, new EventId(2, "ResponseStarted"), "The response has already started, the error handler will not be executed.");

private static readonly Action<ILogger, Exception> _errorHandlerException =
LoggerMessage.Define(LogLevel.Error, new EventId(3, "Exception"), "An exception was thrown attempting to execute the error handler.");

private static readonly Action<ILogger, Exception> _errorHandlerNotFound =
private static readonly Action<ILogger, Exception?> _errorHandlerNotFound =
LoggerMessage.Define(LogLevel.Warning, new EventId(4, "HandlerNotFound"), "No exception handler was found, rethrowing original exception.");

// DeveloperExceptionPageMiddleware
private static readonly Action<ILogger, Exception> _responseStartedErrorPageMiddleware =
private static readonly Action<ILogger, Exception?> _responseStartedErrorPageMiddleware =
LoggerMessage.Define(LogLevel.Warning, new EventId(2, "ResponseStarted"), "The response has already started, the error page middleware will not be executed.");

private static readonly Action<ILogger, Exception> _displayErrorPageException =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

#nullable enable

using System;
using Microsoft.AspNetCore.Diagnostics;
using Microsoft.AspNetCore.Http;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

#nullable enable

using System;

namespace Microsoft.AspNetCore.Diagnostics
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

#nullable enable

using System;
using System.Diagnostics;
using System.Runtime.ExceptionServices;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using Microsoft.AspNetCore.Diagnostics;
#nullable enable

using Microsoft.AspNetCore.Http;

namespace Microsoft.AspNetCore.Builder
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

#nullable enable

using System;
using Microsoft.AspNetCore.Builder;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>aspnetcore;diagnostics</PackageTags>
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading