From 16d9fe3b6091badbaf6e6700073219c5327fe9cd Mon Sep 17 00:00:00 2001 From: HojouFotytu <36724681+HojouFotytu@users.noreply.github.com> Date: Fri, 15 Nov 2019 12:18:43 +0900 Subject: [PATCH 1/3] Logger --- Core/Main/PTMagic.cs | 2 -- Monitor/Pages/Error.cshtml | 5 +++++ Monitor/Pages/Error.cshtml.cs | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Core/Main/PTMagic.cs b/Core/Main/PTMagic.cs index 8c3598e..fc5c7ce 100644 --- a/Core/Main/PTMagic.cs +++ b/Core/Main/PTMagic.cs @@ -2323,8 +2323,6 @@ namespace Core.Main } } - this.Log.DoLogInfo("DCA ProfitPercentage Label:" + ProfitPercentageLabel); - // Get configured DCA triggers for (int dca = 1; dca <= maxDCALevel; dca++) { diff --git a/Monitor/Pages/Error.cshtml b/Monitor/Pages/Error.cshtml index 0ea6585..6c83966 100644 --- a/Monitor/Pages/Error.cshtml +++ b/Monitor/Pages/Error.cshtml @@ -13,4 +13,9 @@

Request ID: @Model.RequestId

+} + +@if (Model.Exception != null) { +

@Model.Exception.Error.Message

+

@Model.Exception.Error.StackTrace

} \ No newline at end of file diff --git a/Monitor/Pages/Error.cshtml.cs b/Monitor/Pages/Error.cshtml.cs index f96bf8a..ccf6208 100644 --- a/Monitor/Pages/Error.cshtml.cs +++ b/Monitor/Pages/Error.cshtml.cs @@ -7,11 +7,14 @@ namespace Monitor.Pages public class ErrorModel : PageModel { public string RequestId { get; set; } + public IExceptionHandlerFeature Exception = null; public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); public void OnGet() { + Exception = HttpContext.Features.Get(); + var exceptionFeature = HttpContext.Features.Get(); RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; From 952555495e4c496823ce0ca1ce05d9c3064a72d5 Mon Sep 17 00:00:00 2001 From: HojouFotytu <36724681+HojouFotytu@users.noreply.github.com> Date: Sat, 16 Nov 2019 10:19:02 +0900 Subject: [PATCH 2/3] ignore error lastruntimesummary.json in use --- Monitor/Pages/Error.cshtml.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Monitor/Pages/Error.cshtml.cs b/Monitor/Pages/Error.cshtml.cs index ccf6208..e692535 100644 --- a/Monitor/Pages/Error.cshtml.cs +++ b/Monitor/Pages/Error.cshtml.cs @@ -19,7 +19,10 @@ namespace Monitor.Pages RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; - Logger.WriteException(exceptionFeature.Error, "An error occurred whilst requesting " + exceptionFeature.Path); + string errorString = exceptionFeature.Error.ToString(); + if (!errorString.Contains("is being used")) { + Logger.WriteException(exceptionFeature.Error, "An error occurred whilst requesting " + exceptionFeature.Path); + } } } } From 796d072d37aed77f730aa81a9b27561c346157ea Mon Sep 17 00:00:00 2001 From: HojouFotytu <36724681+HojouFotytu@users.noreply.github.com> Date: Sat, 16 Nov 2019 11:31:22 +0900 Subject: [PATCH 3/3] ignore error analyzer parsing --- Monitor/Pages/Error.cshtml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Monitor/Pages/Error.cshtml.cs b/Monitor/Pages/Error.cshtml.cs index e692535..6f18d5e 100644 --- a/Monitor/Pages/Error.cshtml.cs +++ b/Monitor/Pages/Error.cshtml.cs @@ -20,7 +20,7 @@ namespace Monitor.Pages RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; string errorString = exceptionFeature.Error.ToString(); - if (!errorString.Contains("is being used")) { + if (!(errorString.Contains("is being used") || errorString.Contains("an unexpected character was encountered"))) { Logger.WriteException(exceptionFeature.Error, "An error occurred whilst requesting " + exceptionFeature.Path); } }