Skip to content

Commit a657ef4

Browse files
committed
Adding SentrySdk.CaptureException(e);
1 parent 2916cf6 commit a657ef4

File tree

8 files changed

+53
-1
lines changed

8 files changed

+53
-1
lines changed

eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Services/BackendConfigurationAssignmentWorkerService/BackendConfigurationAssignmentWorkerService.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3131
using Microting.ItemsPlanningBase.Infrastructure.Data;
3232
using Microting.TimePlanningBase.Infrastructure.Data;
3333
using Rebus.Bus;
34+
using Sentry;
3435

3536
namespace BackendConfiguration.Pn.Services.BackendConfigurationAssignmentWorkerService;
3637

@@ -183,6 +184,7 @@ public async Task<OperationDataResult<List<PropertyAssignWorkersModel>>> GetProp
183184
}
184185
catch (Exception ex)
185186
{
187+
SentrySdk.CaptureException(ex);
186188
Log.LogException(ex.Message);
187189
Log.LogException(ex.StackTrace);
188190
return new OperationDataResult<List<PropertyAssignWorkersModel>>(false,
@@ -244,6 +246,7 @@ public async Task<OperationDataResult<List<PropertyAssignWorkersModel>>> GetSimp
244246
}
245247
catch (Exception ex)
246248
{
249+
SentrySdk.CaptureException(ex);
247250
Log.LogException(ex.Message);
248251
Log.LogException(ex.StackTrace);
249252
return new OperationDataResult<List<PropertyAssignWorkersModel>>(false,
@@ -348,6 +351,7 @@ await BackendConfigurationAssignmentWorkerServiceHelper
348351
}
349352
catch (Exception e)
350353
{
354+
SentrySdk.CaptureException(e);
351355
Log.LogException(e.Message);
352356
Log.LogException(e.StackTrace);
353357
return new OperationResult(false,
@@ -390,6 +394,7 @@ join worker in sdkDbContext.Workers on siteWorker.WorkerId equals worker.Id
390394
}
391395
catch (Exception e)
392396
{
397+
SentrySdk.CaptureException(e);
393398
Console.WriteLine(e);
394399
}
395400

@@ -516,6 +521,7 @@ join worker in sdkDbContext.Workers on siteWorker.WorkerId equals worker.Id
516521
}
517522
catch (Exception ex)
518523
{
524+
SentrySdk.CaptureException(ex);
519525
return new OperationDataResult<List<DeviceUserModel>>(false, _backendConfigurationLocalizationService.GetStringWithFormat("ErrorWhileGetDeviceUsers") + " " + ex.Message);
520526
}
521527
}

eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Services/BackendConfigurationPropertiesService/BackendConfigurationPropertiesService.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3030
using Microting.eForm.Infrastructure.Data.Entities;
3131
using Microting.eFormApi.BasePn.Infrastructure.Helpers.PluginDbOptions;
3232
using Rebus.Bus;
33+
using Sentry;
3334

3435
namespace BackendConfiguration.Pn.Services.BackendConfigurationPropertiesService;
3536

@@ -132,6 +133,7 @@ public async Task<OperationDataResult<Paged<PropertiesModel>>> Index(PropertiesR
132133
}
133134
catch (Exception ex)
134135
{
136+
SentrySdk.CaptureException(ex);
135137
Log.LogException(ex.Message);
136138
Log.LogException(ex.StackTrace);
137139
return new OperationDataResult<Paged<PropertiesModel>>(false,
@@ -188,6 +190,7 @@ public async Task<OperationDataResult<PropertiesModel>> Read(int id)
188190
}
189191
catch (Exception e)
190192
{
193+
SentrySdk.CaptureException(e);
191194
Log.LogException(e.Message);
192195
Log.LogException(e.StackTrace);
193196
return new OperationDataResult<PropertiesModel>(false,
@@ -502,6 +505,7 @@ await core.EntityGroupDelete(property.EntitySearchListPoolWorkers.ToString())
502505
}
503506
catch (Exception e)
504507
{
508+
SentrySdk.CaptureException(e);
505509
Log.LogException(e.Message);
506510
Log.LogException(e.StackTrace);
507511
return new OperationResult(false,
@@ -525,6 +529,7 @@ public async Task<OperationDataResult<List<CommonDictionaryModel>>> GetCommonDic
525529
}
526530
catch (Exception ex)
527531
{
532+
SentrySdk.CaptureException(ex);
528533
Log.LogException(ex.Message);
529534
Log.LogException(ex.StackTrace);
530535
return new OperationDataResult<List<CommonDictionaryModel>>(false,
@@ -551,6 +556,7 @@ public async Task<OperationDataResult<ChrResult>> GetChrInformation(int chrNumbe
551556
}
552557
catch (Exception e)
553558
{
559+
SentrySdk.CaptureException(e);
554560
return new OperationDataResult<ChrResult>(false, e.Message);
555561
}
556562
}
@@ -586,6 +592,7 @@ public async Task<OperationDataResult<List<CommonDictionaryModel>>> GetLinkedFol
586592
}
587593
catch (Exception e)
588594
{
595+
SentrySdk.CaptureException(e);
589596
return new OperationDataResult<List<CommonDictionaryModel>>(false, e.Message);
590597
}
591598
}
@@ -621,6 +628,7 @@ public async Task<OperationDataResult<List<CommonDictionaryModel>>> GetLinkedFol
621628
}
622629
catch (Exception e)
623630
{
631+
SentrySdk.CaptureException(e);
624632
return new OperationDataResult<List<CommonDictionaryModel>>(false, e.Message);
625633
}
626634
}
@@ -662,6 +670,7 @@ public async Task<OperationDataResult<List<PropertyFolderModel>>> GetLinkedFolde
662670
}
663671
catch (Exception e)
664672
{
673+
SentrySdk.CaptureException(e);
665674
return new OperationDataResult<List<PropertyFolderModel>>(false, e.Message);
666675
}
667676
}
@@ -702,6 +711,7 @@ public async Task<OperationDataResult<List<PropertyFolderModel>>> GetLinkedFolde
702711
}
703712
catch (Exception e)
704713
{
714+
SentrySdk.CaptureException(e);
705715
return new OperationDataResult<List<PropertyFolderModel>>(false, e.Message);
706716
}
707717
}
@@ -750,6 +760,7 @@ public async Task<OperationDataResult<List<CommonDictionaryModel>>> GetLinkedSit
750760
}
751761
catch (Exception e)
752762
{
763+
SentrySdk.CaptureException(e);
753764
return new OperationDataResult<List<CommonDictionaryModel>>(false, e.Message);
754765
}
755766
}
@@ -788,6 +799,7 @@ public async Task<OperationDataResult<List<CommonDictionaryModel>>> GetLinkedSit
788799
}
789800
catch (Exception e)
790801
{
802+
SentrySdk.CaptureException(e);
791803
return new OperationDataResult<List<CommonDictionaryModel>>(false, e.Message);
792804
}
793805
}

eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Services/BackendConfigurationReportService/BackendConfigurationReportService.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -957,6 +957,7 @@ or Constants.FieldTypes.None
957957
}
958958
catch (Exception e)
959959
{
960+
SentrySdk.CaptureException(e);
960961
Trace.TraceError(e.Message);
961962
_logger.LogError(e.Message);
962963
_logger.LogError(e.StackTrace);
@@ -1042,6 +1043,7 @@ public async Task<OperationDataResult<Stream>> GenerateReportFile(GenerateReport
10421043
}
10431044
catch (Exception e)
10441045
{
1046+
SentrySdk.CaptureException(e);
10451047
Trace.TraceError(e.Message);
10461048
_logger.LogError(e.Message);
10471049
_logger.LogError(e.StackTrace);
@@ -1123,6 +1125,7 @@ public async Task<OperationDataResult<Stream>> GenerateReportFile(GenerateReport
11231125
}
11241126
catch (Exception e)
11251127
{
1128+
SentrySdk.CaptureException(e);
11261129
Trace.TraceError(e.Message);
11271130
_logger.LogError(e.Message);
11281131
_logger.LogError(e.StackTrace);
@@ -1148,6 +1151,7 @@ public async Task<OperationResult> Update(ReplyRequest model)
11481151
}
11491152
catch (Exception ex)
11501153
{
1154+
SentrySdk.CaptureException(ex);
11511155
Log.LogException(ex.Message);
11521156
Log.LogException(ex.StackTrace);
11531157
return new OperationResult(false, $"{_backendConfigurationLocalizationService.GetString("CaseCouldNotBeUpdated")} Exception: {ex.Message}");
@@ -1209,6 +1213,7 @@ public async Task<OperationResult> Update(ReplyRequest model)
12091213
}
12101214
catch (Exception ex)
12111215
{
1216+
SentrySdk.CaptureException(ex);
12121217
Log.LogException(ex.Message);
12131218
Log.LogException(ex.StackTrace);
12141219
return new OperationResult(false, _backendConfigurationLocalizationService.GetString("CaseCouldNotBeUpdated") + $" Exception: {ex.Message}");

eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Services/BackendConfigurationStatsService/BackendConfigurationStatsService.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
namespace BackendConfiguration.Pn.Services.BackendConfigurationStatsService;
1+
using Sentry;
2+
3+
namespace BackendConfiguration.Pn.Services.BackendConfigurationStatsService;
24

35
using BackendConfigurationLocalizationService;
46
using Microsoft.Extensions.Logging;
@@ -100,6 +102,7 @@ public async Task<OperationDataResult<PlannedTaskDays>> GetPlannedTaskDays(int?
100102
}
101103
catch (Exception e)
102104
{
105+
SentrySdk.CaptureException(e);
103106
Console.WriteLine(e);
104107
_logger.LogError(e.Message);
105108
return new OperationDataResult<PlannedTaskDays>(false,
@@ -177,6 +180,7 @@ public async Task<OperationDataResult<AdHocTaskPriorities>> GetAdHocTaskPrioriti
177180
}
178181
catch (Exception e)
179182
{
183+
SentrySdk.CaptureException(e);
180184
Console.WriteLine(e);
181185
_logger.LogError(e.Message);
182186
return new OperationDataResult<AdHocTaskPriorities>(false,
@@ -221,6 +225,7 @@ public async Task<OperationDataResult<DocumentUpdatedDays>> GetDocumentUpdatedDa
221225
}
222226
catch (Exception e)
223227
{
228+
SentrySdk.CaptureException(e);
224229
Console.WriteLine(e);
225230
_logger.LogError(e.Message);
226231
return new OperationDataResult<DocumentUpdatedDays>(false,
@@ -297,6 +302,7 @@ public async Task<OperationDataResult<PlannedTaskWorkers>> GetPlannedTaskWorkers
297302
}
298303
catch (Exception e)
299304
{
305+
SentrySdk.CaptureException(e);
300306
Console.WriteLine(e);
301307
_logger.LogError(e.Message);
302308
return new OperationDataResult<PlannedTaskWorkers>(false,
@@ -386,6 +392,7 @@ public async Task<OperationDataResult<AdHocTaskWorkers>> GetAdHocTaskWorkers(int
386392
}
387393
catch (Exception e)
388394
{
395+
SentrySdk.CaptureException(e);
389396
Console.WriteLine(e);
390397
_logger.LogError(e.Message);
391398
return new OperationDataResult<AdHocTaskWorkers>(false,

eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Services/BackendConfigurationTaskManagementService/BackendConfigurationTaskManagementService.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ public async Task<OperationResult> DeleteTaskById(int workOrderCaseId)
319319
try { await core.CaseDelete(workOrderCase.CaseId).ConfigureAwait(false); }
320320
catch (Exception e)
321321
{
322+
SentrySdk.CaptureException(e);
322323
Log.LogException(e.Message);
323324
Log.LogException(e.StackTrace);
324325
}
@@ -362,6 +363,7 @@ public async Task<OperationResult> DeleteTaskById(int workOrderCaseId)
362363
}
363364
catch (Exception e)
364365
{
366+
SentrySdk.CaptureException(e);
365367
Log.LogException(e.Message);
366368
Log.LogException(e.StackTrace);
367369
}
@@ -384,6 +386,7 @@ public async Task<OperationResult> DeleteTaskById(int workOrderCaseId)
384386
}
385387
catch (Exception e)
386388
{
389+
SentrySdk.CaptureException(e);
387390
Log.LogException(e.Message);
388391
Log.LogException(e.StackTrace);
389392
}

eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Services/BackendConfigurationTaskTrackerService/BackendConfigurationTaskTrackerService.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2323
*/
2424

2525
using Microting.EformBackendConfigurationBase.Infrastructure.Data.Entities;
26+
using Sentry;
2627

2728
namespace BackendConfiguration.Pn.Services.BackendConfigurationTaskTrackerService;
2829

@@ -93,6 +94,7 @@ public async Task<OperationDataResult<List<TaskTrackerColumn>>> GetColumns()
9394
}
9495
catch (Exception e)
9596
{
97+
SentrySdk.CaptureException(e);
9698
Log.LogException(e.Message);
9799
Log.LogException(e.StackTrace);
98100
return new OperationDataResult<List<TaskTrackerColumn>>(false,
@@ -141,6 +143,7 @@ public async Task<OperationResult> UpdateColumns(List<TaskTrackerColumns> update
141143
}
142144
catch (Exception e)
143145
{
146+
SentrySdk.CaptureException(e);
144147
Log.LogException(e.Message);
145148
Log.LogException(e.StackTrace);
146149
return new OperationResult(false,
@@ -170,6 +173,7 @@ public async Task<OperationDataResult<Stream>> GenerateExcelReport(TaskTrackerFi
170173
}
171174
catch (Exception e)
172175
{
176+
SentrySdk.CaptureException(e);
173177
Log.LogException(e.Message);
174178
Log.LogException(e.StackTrace);
175179
return new OperationDataResult<Stream>(false, $"{_localizationService.GetString("ErrorWhileGeneratingReport")}: {e.Message}");

eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Services/BackendConfigurationTaskWizardService/BackendConfigurationTaskWizardService.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using Sentry;
2+
13
namespace BackendConfiguration.Pn.Services.BackendConfigurationTaskWizardService;
24

35
using BackendConfigurationLocalizationService;
@@ -214,6 +216,7 @@ public async Task<OperationDataResult<List<TaskWizardModel>>> Index(TaskWizardRe
214216
}
215217
catch (Exception e)
216218
{
219+
SentrySdk.CaptureException(e);
217220
Console.WriteLine(e);
218221
_logger.LogError(e.Message);
219222
return new OperationDataResult<List<TaskWizardModel>>(false,
@@ -241,6 +244,7 @@ public async Task<OperationDataResult<List<CommonDictionaryModel>>> GetPropertie
241244
}
242245
catch (Exception ex)
243246
{
247+
SentrySdk.CaptureException(ex);
244248
Log.LogException(ex.Message);
245249
Log.LogException(ex.StackTrace);
246250
return new OperationDataResult<List<CommonDictionaryModel>>(false,
@@ -319,6 +323,7 @@ public async Task<OperationDataResult<TaskWizardTaskModel>> GetTaskById(int id,
319323
}
320324
catch (Exception e)
321325
{
326+
SentrySdk.CaptureException(e);
322327
Console.WriteLine(e);
323328
_logger.LogError(e.Message);
324329
return new OperationDataResult<TaskWizardTaskModel>(false,
@@ -566,6 +571,7 @@ await PairItemWithSiteHelper.Pair(
566571
}
567572
catch (Exception e)
568573
{
574+
SentrySdk.CaptureException(e);
569575
Console.WriteLine(e);
570576
Console.WriteLine(e.StackTrace);
571577
_logger.LogError(e.Message);
@@ -1158,6 +1164,7 @@ await compliance.Delete(_backendConfigurationPnDbContext)
11581164
}
11591165
catch (Exception e)
11601166
{
1167+
SentrySdk.CaptureException(e);
11611168
Console.WriteLine(e);
11621169
_logger.LogError(e.Message);
11631170
return new OperationResult(false,
@@ -1264,6 +1271,7 @@ await compliance.Delete(_backendConfigurationPnDbContext)
12641271
}
12651272
catch (Exception e)
12661273
{
1274+
SentrySdk.CaptureException(e);
12671275
Console.WriteLine(e);
12681276
_logger.LogError(e.Message);
12691277
return new OperationResult(false,

eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Services/WordService/WordService.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2222
SOFTWARE.
2323
*/
2424

25+
using Sentry;
26+
2527
namespace BackendConfiguration.Pn.Services.WordService;
2628

2729
using Infrastructure.Models.Report;
@@ -122,6 +124,7 @@ public async Task<OperationDataResult<Stream>> GenerateReport(int propertyId, in
122124
}
123125
catch (Exception e)
124126
{
127+
SentrySdk.CaptureException(e);
125128
Trace.TraceError(e.Message);
126129
_logger.LogError(e.Message);
127130
return new OperationDataResult<Stream>(
@@ -737,6 +740,7 @@ public async Task<OperationDataResult<Stream>> GenerateWordDashboard(List<OldRep
737740
}
738741
catch (Exception e)
739742
{
743+
SentrySdk.CaptureException(e);
740744
Trace.TraceError(e.Message);
741745
_logger.LogError(e.Message);
742746
}
@@ -756,6 +760,7 @@ public async Task<OperationDataResult<Stream>> GenerateWordDashboard(List<OldRep
756760
}
757761
catch (Exception e)
758762
{
763+
SentrySdk.CaptureException(e);
759764
Trace.TraceError(e.Message);
760765
_logger.LogError(e.Message);
761766
return new OperationDataResult<Stream>(
@@ -930,6 +935,7 @@ public async Task<OperationDataResult<Stream>> GenerateWordDashboard(List<Report
930935
}
931936
catch (Exception e)
932937
{
938+
SentrySdk.CaptureException(e);
933939
Trace.TraceError(e.Message);
934940
_logger.LogError(e.Message);
935941
return new OperationDataResult<Stream>(
@@ -987,6 +993,7 @@ private async Task<StringBuilder> InsertImage(string imageName, StringBuilder it
987993
}
988994
catch (Exception e)
989995
{
996+
SentrySdk.CaptureException(e);
990997
Trace.TraceError(e.Message);
991998
Trace.TraceError(e.StackTrace);
992999
_logger.LogError(e.StackTrace);

0 commit comments

Comments
 (0)