Skip to content

Commit 5a0d175

Browse files
Ihar YakimushIhar Yakimush
authored andcommitted
release 2.0.2
1 parent 845726e commit 5a0d175

File tree

7 files changed

+18
-13
lines changed

7 files changed

+18
-13
lines changed

Community.AspNetCore.ExceptionHandling.Mvc/Community.AspNetCore.ExceptionHandling.Mvc.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
<PackageLicenseUrl>https://github.com/IharYakimush/asp-net-core-exception-handling/blob/develop/LICENSE</PackageLicenseUrl>
88
<Copyright>IharYakimush</Copyright>
99
<PackageTags>aspnetcore exception handling policy mvc action result</PackageTags>
10-
<AssemblyVersion>2.0.1.0</AssemblyVersion>
10+
<AssemblyVersion>2.0.2.0</AssemblyVersion>
1111
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
1212
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
13-
<FileVersion>2.0.1.0</FileVersion>
13+
<FileVersion>2.0.2.0</FileVersion>
1414
<Company />
1515
<Authors>IharYakimush</Authors>
16-
<Version>2.0.1</Version>
16+
<Version>2.0.2</Version>
1717
<SignAssembly>true</SignAssembly>
1818
<AssemblyOriginatorKeyFile>..\sgn.snk</AssemblyOriginatorKeyFile>
1919
<ApplicationIcon />

Community.AspNetCore.ExceptionHandling.NewtonsoftJson/Community.AspNetCore.ExceptionHandling.NewtonsoftJson.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
<PackageLicenseUrl>https://github.com/IharYakimush/asp-net-core-exception-handling/blob/develop/LICENSE</PackageLicenseUrl>
99
<PackageProjectUrl>https://github.com/IharYakimush/asp-net-core-exception-handling</PackageProjectUrl>
1010
<PackageTags>aspnetcore exception handling policy json response</PackageTags>
11-
<AssemblyVersion>2.0.1.0</AssemblyVersion>
12-
<Version>2.0.1</Version>
11+
<AssemblyVersion>2.0.2.0</AssemblyVersion>
12+
<Version>2.0.2</Version>
1313
<Company />
1414
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
1515
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>

Community.AspNetCore.ExceptionHandling.NewtonsoftJson/PolicyBuilderExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static class PolicyBuilderExtensions
3636
/// <returns>
3737
/// Policy builder
3838
/// </returns>
39-
[Obsolete("In case of using netcore2.1+ use Commmunity.AspNetCore.ExceptionHandling.Mvc instead")]
39+
[Obsolete("In case of using netcore2.1+ use Community.AspNetCore.ExceptionHandling.Mvc instead")]
4040
public static IResponseHandlers<TException> WithBodyJson<TException, TObject>(
4141
this IResponseHandlers<TException> builder, Func<HttpRequest, TException, TObject> valueFactory, JsonSerializerSettings settings = null, int index = -1)
4242
where TException : Exception

Community.AspNetCore.ExceptionHandling/Community.AspNetCore.ExceptionHandling.csproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,19 @@
77
<PackageLicenseUrl>https://github.com/IharYakimush/asp-net-core-exception-handling/blob/develop/LICENSE</PackageLicenseUrl>
88
<Copyright>IharYakimush</Copyright>
99
<PackageTags>aspnetcore exception handling policy</PackageTags>
10-
<AssemblyVersion>2.0.1.0</AssemblyVersion>
10+
<AssemblyVersion>2.0.2.0</AssemblyVersion>
1111
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
1212
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
13-
<FileVersion>2.0.1.0</FileVersion>
13+
<FileVersion>2.0.2.0</FileVersion>
1414
<Company />
1515
<Authors>IharYakimush</Authors>
16-
<Version>2.0.1</Version>
16+
<Version>2.0.2</Version>
1717
<SignAssembly>true</SignAssembly>
1818
<AssemblyOriginatorKeyFile>..\sgn.snk</AssemblyOriginatorKeyFile>
1919
<ApplicationIcon />
2020
<OutputType>Library</OutputType>
2121
<StartupObject />
22+
<PackageReleaseNotes>WithBody method changed to use Stream instead of StreamWriter to unify behaviour in case of buffered and chunked responses</PackageReleaseNotes>
2223
</PropertyGroup>
2324

2425
<PropertyGroup Condition="'$(Configuration)'=='Debug'">

Community.AspNetCore.ExceptionHandling/Const.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
{
33
public static class Const
44
{
5-
public const string Category = "Commmunity.AspNetCore.ExceptionHandling";
5+
public const string Category = "Community.AspNetCore.ExceptionHandling";
66
}
77
}

Community.AspNetCore.ExceptionHandling/Logs/LogHandlerOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class LogHandlerOptions<TException> : HandlerWithLoggerOptions, IOptions<
3434
public Func<HttpContext, TException, LogHandlerOptions<TException>, object> StateFactory { get; set; }
3535

3636
/// <summary>
37-
/// Factory for log category. By default "Commmunity.AspNetCore.ExceptionHandling" will be used.
37+
/// Factory for log category. By default "Community.AspNetCore.ExceptionHandling" will be used.
3838
/// </summary>
3939
public Func<HttpContext, TException, string> Category { get; set; }
4040

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ public void ConfigureServices(IServiceCollection services)
1616
options.For<SomeBadRequestException>()
1717
.Response(e => 400)
1818
.Headers((h, e) => h["X-MyCustomHeader"] = e.Message)
19-
.WithBody((req,sw, exception) => sw.WriteAsync(exception.ToString()))
19+
.WithBody((req,sw, exception) =>
20+
{
21+
byte[] array = Encoding.UTF8.GetBytes(exception.ToString());
22+
return sw.WriteAsync(array, 0, array.Length);
23+
})
2024
.NextPolicy();
2125
2226
// Ensure that all exception types are handled by adding handler for generic exception at the end.
@@ -62,4 +66,4 @@ Sample of transitions:
6266
| ---------| ------------- | ------------- |
6367
| Community.AspNetCore.ExceptionHandling | netstandard2.0 netcoreapp2.1 | Main functionality |
6468
| Community.AspNetCore.ExceptionHandling.Mvc | netcoreapp2.1 | Alllow to use MVC IActionResult (including ObjectResult) in 'Response' handler |
65-
| Community.AspNetCore.ExceptionHandling.NewtonsoftJson | netstandard2.0 | Allow to set Json serialized object as a response body in 'Response' handler. Use it only if 'Commmunity.AspNetCore.ExceptionHandling.Mvc' usage not possible |
69+
| Community.AspNetCore.ExceptionHandling.NewtonsoftJson | netstandard2.0 | Allow to set Json serialized object as a response body in 'Response' handler. Use it only if 'Community.AspNetCore.ExceptionHandling.Mvc' usage not possible |

0 commit comments

Comments
 (0)