From 69cead72f1e56325b2fd7468fd1a2bfafcdf10a2 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 22 Jan 2021 17:54:34 +0000 Subject: [PATCH] --- server/AyaNova/DataList/DataListFetcher.cs | 38 ++++++++++++++----- .../DataList/PartInventoryOnHandDataList.cs | 9 +++-- server/AyaNova/PickList/PickListFetcher.cs | 15 ++++++-- 3 files changed, 46 insertions(+), 16 deletions(-) diff --git a/server/AyaNova/DataList/DataListFetcher.cs b/server/AyaNova/DataList/DataListFetcher.cs index 807ad351..2a42ec5a 100644 --- a/server/AyaNova/DataList/DataListFetcher.cs +++ b/server/AyaNova/DataList/DataListFetcher.cs @@ -217,14 +217,24 @@ namespace AyaNova.DataList catch (Npgsql.PostgresException e) { //log out the exception and the query - log.LogInformation("DataList query failed unexpectedly. Data Query was:"); - log.LogInformation(qDataQuery); - log.LogInformation("Count Query was:"); - log.LogInformation(qTotalRecordsQuery); - log.LogInformation(e, "DB Exception"); - throw new System.Exception("DataListFetcher - Query failed see log"); + log.LogError("DataListFetcher:GetResponseAsync query failed. Data Query was:"); + log.LogError(qDataQuery); + log.LogError("Count Query was:"); + log.LogError(qTotalRecordsQuery); + log.LogError(e, "DB Exception"); + throw new System.Exception("DataListFetcher:GetResponseAsync - Query failed see log"); } + catch (System.Exception e) + { + //ensure any other type of exception gets surfaced properly + //log out the exception and the query + log.LogError("DataListFetcher:GetResponseAsync unexpected failure. Data Query was:"); + log.LogError(qDataQuery); + + log.LogError(e, "Exception"); + throw new System.Exception("DataListFetcher:GetResponseAsync - unexpected failure see log"); + } } @@ -336,12 +346,22 @@ namespace AyaNova.DataList catch (Npgsql.PostgresException e) { //log out the exception and the query - log.LogInformation("DataListFetcher:GetIdListResponseAsync query failed unexpectedly. Data Query was:"); - log.LogInformation(qDataQuery); + log.LogError("DataListFetcher:GetIdListResponseAsync query failed unexpectedly. IDList Query was:"); + log.LogError(qDataQuery); - log.LogInformation(e, "DB Exception"); + log.LogError(e, "DB Exception"); throw new System.Exception("DataListFetcher:GetIdListResponseAsync - Query failed see log"); } + catch (System.Exception e) + { + //ensure any other type of exception gets surfaced properly + //log out the exception and the query + log.LogError("DataListFetcher:GetIdListResponseAsync unexpected failure. IDList Query was:"); + log.LogError(qDataQuery); + + log.LogError(e, "Exception"); + throw new System.Exception("DataListFetcher:GetIdListResponseAsync - unexpected failure see log"); + } } return retList.ToArray(); } diff --git a/server/AyaNova/DataList/PartInventoryOnHandDataList.cs b/server/AyaNova/DataList/PartInventoryOnHandDataList.cs index 5f66b100..4f445623 100644 --- a/server/AyaNova/DataList/PartInventoryOnHandDataList.cs +++ b/server/AyaNova/DataList/PartInventoryOnHandDataList.cs @@ -35,9 +35,9 @@ namespace AyaNova.DataList cm.fld = "PartInventoryBalance"; dlistView.Add(cm); - cm = new JObject(); - cm.fld = "PartInventoryTransactionDescription"; - dlistView.Add(cm); + // cm = new JObject(); + // cm.fld = "PartInventoryTransactionDescription"; + // dlistView.Add(cm); DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None); @@ -82,7 +82,8 @@ namespace AyaNova.DataList UiFieldDataType = (int)UiFieldDataType.Text, SqlIdColumnName = "vpartinventorynow.id", SqlValueColumnName = "vpartinventorynow.description", - IsRowId = true//should open to eventlog since no edit + IsMeta=true,//only so it doesn't show in the UI but is required for report + IsRowId = true }); // FieldDefinitions.Add(new AyaDataListFieldDefinition diff --git a/server/AyaNova/PickList/PickListFetcher.cs b/server/AyaNova/PickList/PickListFetcher.cs index 9a050604..0f384a19 100644 --- a/server/AyaNova/PickList/PickListFetcher.cs +++ b/server/AyaNova/PickList/PickListFetcher.cs @@ -72,11 +72,20 @@ namespace AyaNova.PickList //This may be called internally in *Biz classes who don't have a log of their own if (log == null) log = AyaNova.Util.ApplicationLogging.CreateLogger("PickListFetcher"); - log.LogInformation("PickList query failed unexpectedly. Query was:"); - log.LogInformation(q); - log.LogInformation(e, "DB Exception"); + log.LogError("PickList query failed unexpectedly. Query was:"); + log.LogError(q); + log.LogError(e, "DB Exception"); throw new System.Exception("PickListFetcher - Query failed see log"); + } + catch (System.Exception e) + { + //ensure any other type of exception gets surfaced properly + //log out the exception and the query + log.LogError("PickListFetcher unexpected failure. Query was:"); + log.LogError(q); + log.LogError(e, "Exception"); + throw new System.Exception("PickListFetcher - unexpected failure see log"); } } return ret;