Skip to content

Commit

Permalink
#185456855 Improve error response body logging v2.0.8 (#26)
Browse files Browse the repository at this point in the history
* Improve error response body logging

* Update version in nuspec
  • Loading branch information
CodeYouMust authored Jun 22, 2023
1 parent 5c3bc1a commit c954a28
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2022 Moesif, Inc
Copyright (c) 2023 Moesif, Inc

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
5 changes: 1 addition & 4 deletions Moesif.Api/Controllers/BaseController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using Moesif.Api.Exceptions;
using System.IO;
using System.Text;
using Newtonsoft.Json.Linq;

namespace Moesif.Api.Controllers
{
Expand Down Expand Up @@ -63,9 +62,7 @@ internal void ValidateResponse(HttpResponse _response, HttpContext _context)
Byte[] bytes = new byte[body.Length];
body.Position = 0;
body.Read(bytes, 0, (int)body.Length);
string bodyStr = Encoding.UTF8.GetString(bytes);
JObject jsonErr = JObject.Parse(bodyStr);
bodyData = (string)jsonErr["moesif_error"]["msg"];
bodyData = Encoding.UTF8.GetString(bytes);
}
}
catch (Exception) { };
Expand Down
4 changes: 2 additions & 2 deletions Moesif.Api/Moesif.Api.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package >
<metadata>
<id>Moesif.Api</id>
<version>2.0.7</version>
<version>2.0.8</version>
<title>MoesifApi</title>
<authors>Moesif</authors>
<owners>Moesif</owners>
Expand All @@ -13,7 +13,7 @@
<description>Log API Calls to Moesif API Analytics</description>
<summary />
<releaseNotes />
<copyright>Copyright 2020</copyright>
<copyright>Copyright 2023</copyright>
<language>en-US</language>
<tags>azure web app moesif API analytics insights debug debugging log logging apm performance monitor monitoring restful rest graphql ethereum web3 json-rpc soap net microsoft</tags>
<dependencies>
Expand Down
6 changes: 3 additions & 3 deletions Moesif.Api/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Moesif, Inc")]
[assembly: AssemblyProduct("Moesif.Api")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Version information for an assembly consists of the following four values:
Expand All @@ -23,5 +23,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.7")]
[assembly: AssemblyFileVersion("2.0.7")]
[assembly: AssemblyVersion("2.0.8")]
[assembly: AssemblyFileVersion("2.0.8")]

0 comments on commit c954a28

Please sign in to comment.