Skip to content

Commit 1d4b369

Browse files
committed
Removed catch all
1 parent a71be5a commit 1d4b369

File tree

2 files changed

+19
-43
lines changed

2 files changed

+19
-43
lines changed

utPLSQL.Api/utPLSQL.Api/RealTimeTestRunner.cs

Lines changed: 17 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using System;
33
using System.Collections.Generic;
44
using System.Data;
5-
using System.Diagnostics;
65
using System.IO;
76
using System.Threading.Tasks;
87
using System.Xml.Serialization;
@@ -16,25 +15,14 @@ public class RealTimeTestRunner : TestRunner<@event>
1615
{
1716
public override async Task RunTestsAsync(List<string> paths, Action<@event> consumer)
1817
{
19-
try
18+
if (paths != null && paths.Count > 0)
2019
{
21-
if (paths != null && paths.Count > 0)
22-
{
23-
var realtimeReporterId = Guid.NewGuid().ToString().Replace("-", "");
20+
var realtimeReporterId = Guid.NewGuid().ToString().Replace("-", "");
2421

25-
var taskRun = Task.Run(() => UtRun(realtimeReporterId, paths));
26-
var taskConsume = Task.Run(() => ConsumeResult(realtimeReporterId, consumer));
22+
var taskRun = Task.Run(() => UtRun(realtimeReporterId, paths));
23+
var taskConsume = Task.Run(() => ConsumeResult(realtimeReporterId, consumer));
2724

28-
await Task.WhenAll(taskRun, taskConsume);
29-
}
30-
}
31-
catch (Exception e)
32-
{
33-
using (EventLog eventLog = new EventLog("Application"))
34-
{
35-
eventLog.Source = "Application";
36-
eventLog.WriteEntry($"{e.Message}\r\n{e.StackTrace}", EventLogEntryType.Error);
37-
}
25+
await Task.WhenAll(taskRun, taskConsume);
3826
}
3927
}
4028

@@ -45,33 +33,21 @@ public override async Task RunTestsAsync(string path, Action<@event> consumer)
4533

4634
public override async Task<string> RunTestsWithCoverageAsync(List<string> paths, Action<@event> consumer, List<string> coverageSchemas = null, List<string> includeObjects = null, List<string> excludeObjects = null)
4735
{
48-
try
36+
if (paths != null && paths.Count > 0)
4937
{
50-
if (paths != null && paths.Count > 0)
51-
{
52-
var realtimeReporterId = Guid.NewGuid().ToString().Replace("-", "");
53-
var coverageReporterId = Guid.NewGuid().ToString().Replace("-", "");
54-
55-
var taskRun = Task.Run(() => UtRunWithCoverage(realtimeReporterId, coverageReporterId, paths, coverageSchemas, includeObjects, excludeObjects));
56-
var taskConsume = Task.Run(() => ConsumeResult(realtimeReporterId, consumer));
57-
var taskCoverageReport = Task.Run(() => GetCoverageReport(coverageReporterId));
58-
59-
await Task.WhenAll(taskRun, taskConsume, taskCoverageReport);
60-
61-
return taskCoverageReport.Result;
62-
}
63-
else
64-
{
65-
return null;
66-
}
38+
var realtimeReporterId = Guid.NewGuid().ToString().Replace("-", "");
39+
var coverageReporterId = Guid.NewGuid().ToString().Replace("-", "");
40+
41+
var taskRun = Task.Run(() => UtRunWithCoverage(realtimeReporterId, coverageReporterId, paths, coverageSchemas, includeObjects, excludeObjects));
42+
var taskConsume = Task.Run(() => ConsumeResult(realtimeReporterId, consumer));
43+
var taskCoverageReport = Task.Run(() => GetCoverageReport(coverageReporterId));
44+
45+
await Task.WhenAll(taskRun, taskConsume, taskCoverageReport);
46+
47+
return taskCoverageReport.Result;
6748
}
68-
catch (Exception e)
49+
else
6950
{
70-
using (EventLog eventLog = new EventLog("Application"))
71-
{
72-
eventLog.Source = "Application";
73-
eventLog.WriteEntry($"{e.Message}\r\n{e.StackTrace}", EventLogEntryType.Error);
74-
}
7551
return null;
7652
}
7753
}

utPLSQL.Api/utPLSQL.Api/utPLSQL.Api.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<package >
33
<metadata>
44
<id>utPLSQL.Api</id>
5-
<version>1.5.5</version>
5+
<version>1.5.6</version>
66
<title>utPLSQL API</title>
77
<authors>Simon Martinelli</authors>
88
<requireLicenseAcceptance>false</requireLicenseAcceptance>
99
<license type="expression">Apache-2.0+</license>
1010
<projectUrl>https://github.com/utPLSQL/utPLSQL-dotnet-api</projectUrl>
1111
<icon>images/blue-icon-transparent.png</icon>
1212
<description>.NET API for utPLSQL</description>
13-
<releaseNotes>Log exceptions to event log</releaseNotes>
13+
<releaseNotes>Log exceptions removed</releaseNotes>
1414
<copyright>Copyright © 2021</copyright>
1515
<tags>utPLSQL</tags>
1616
</metadata>

0 commit comments

Comments
 (0)