Skip to content

Commit 57733aa

Browse files
authored
Changed design to our gray/blue color scheme (#65)
* Done with the new design * Updated ASP.NET Core
1 parent 8a3a531 commit 57733aa

File tree

66 files changed

+33380
-217
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+33380
-217
lines changed

src/Server/Coderr.Server.Api.Client/Coderr.Server.Api.Client.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<AssemblyName>Coderr.Server.Api.Client</AssemblyName>
2323
</PropertyGroup>
2424
<ItemGroup>
25-
<PackageReference Include="DotNetCqs" Version="2.0.9" />
25+
<PackageReference Include="DotNetCqs" Version="2.0.10" />
2626
<PackageReference Include="System.ComponentModel.Annotations" Version="4.4.1" />
2727
</ItemGroup>
2828
<ItemGroup>

src/Server/Coderr.Server.Api/Coderr.Server.Api.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<NoWarn>1701;1702;1705;1591</NoWarn>
2626
</PropertyGroup>
2727
<ItemGroup>
28-
<PackageReference Include="DotNetCqs" Version="2.0.9" />
28+
<PackageReference Include="DotNetCqs" Version="2.0.10" />
2929
</ItemGroup>
3030
<ItemGroup Condition="'$(TargetFramework)' == 'net452'">
3131
<Reference Include="System.Net.Http" />

src/Server/Coderr.Server.App/Coderr.Server.App.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<PackageReference Include="ColorCode" Version="1.0.1">
2222
<NoWarn>NU1701</NoWarn>
2323
</PackageReference>
24-
<PackageReference Include="DotNetCqs" Version="2.0.9" />
24+
<PackageReference Include="DotNetCqs" Version="2.0.10" />
2525
<PackageReference Include="Griffin.Framework" Version="2.0.1" />
2626
<PackageReference Include="log4net" Version="2.0.8" />
2727
<PackageReference Include="Markdig" Version="0.14.9" />

src/Server/Coderr.Server.Domain/Core/Incidents/Events/IncidentCreated.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ namespace Coderr.Server.Domain.Core.Incidents.Events
99
/// </summary>
1010
public class IncidentCreated
1111
{
12-
public IncidentCreated(int incidentId, string incidentDescription, string exceptionTypeName)
12+
public IncidentCreated(int applicationId, int incidentId, string incidentDescription, string exceptionTypeName)
1313
{
1414
if (incidentDescription == null) throw new ArgumentNullException(nameof(incidentDescription));
1515
if (exceptionTypeName == null) throw new ArgumentNullException(nameof(exceptionTypeName));
1616
if (incidentId <= 0) throw new ArgumentOutOfRangeException(nameof(incidentId));
17+
if (applicationId <= 0) throw new ArgumentOutOfRangeException(nameof(applicationId));
18+
ApplicationId = applicationId;
1719
IncidentId = incidentId;
1820

1921
var pos = incidentDescription.IndexOfAny(new[] {'\r', '\n'});

src/Server/Coderr.Server.Infrastructure/Coderr.Server.Infrastructure.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<AssemblyName>Coderr.Server.Infrastructure</AssemblyName>
66
</PropertyGroup>
77
<ItemGroup>
8-
<PackageReference Include="DotNetCqs" Version="2.0.9" />
8+
<PackageReference Include="DotNetCqs" Version="2.0.10" />
99
<PackageReference Include="Griffin.Framework" Version="2.0.1" />
1010
<PackageReference Include="log4net" Version="2.0.8" />
1111
<PackageReference Include="Newtonsoft.Json" Version="11.0.1" />

src/Server/Coderr.Server.ReportAnalyzer/Coderr.Server.ReportAnalyzer.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88
<ItemGroup>
99
<PackageReference Include="Coderr.Client.NetStd" Version="1.1.3" />
10-
<PackageReference Include="DotNetCqs" Version="2.0.9" />
10+
<PackageReference Include="DotNetCqs" Version="2.0.10" />
1111
<PackageReference Include="DotNetCqs.DependencyInjection.Microsoft" Version="1.0.0" />
1212
<PackageReference Include="DotNetCqs.Queues.AdoNet" Version="1.0.6" />
1313
<PackageReference Include="Griffin.Framework" Version="2.0.1" />

src/Server/Coderr.Server.ReportAnalyzer/ErrorOrigins/Handlers/StorePositionFromNewReport.cs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,20 @@ public async Task HandleAsync(IMessageContext context, ReportAddedToIncident e)
4949
if (string.IsNullOrEmpty(_originConfiguration.Value?.ApiKey))
5050
return;
5151

52-
if (e.Report.RemoteAddress == "::1")
53-
return;
54-
if (e.Report.RemoteAddress == "127.0.0.1")
52+
// Random swedish IP for testing purposes
53+
if (e.Report.RemoteAddress == "::1" || e.Report.RemoteAddress == "127.0.0.1")
5554
e.Report.RemoteAddress = "94.254.57.227";
5655

56+
var errorOrigin = await LookupIpAddress(e);
57+
await _repository.CreateAsync(errorOrigin, e.Incident.ApplicationId, e.Incident.Id, e.Report.Id);
58+
}
59+
60+
private async Task<ErrorOrigin> LookupIpAddress(ReportAddedToIncident e)
61+
{
5762
var url = $"http://api.ipstack.com/{e.Report.RemoteAddress}?access_key={_originConfiguration.Value.ApiKey}";
5863
var request = WebRequest.CreateHttp(url);
59-
string json = "";
64+
var json = "";
65+
ErrorOrigin errorOrigin;
6066
try
6167
{
6268
var response = await request.GetResponseAsync();
@@ -71,7 +77,7 @@ public async Task HandleAsync(IMessageContext context, ReportAddedToIncident e)
7177

7278
var lat = double.Parse(jsonObj["latitude"].Value<string>(), CultureInfo.InvariantCulture);
7379
var lon = double.Parse(jsonObj["longitude"].Value<string>(), CultureInfo.InvariantCulture);
74-
var cmd = new ErrorOrigin(e.Report.RemoteAddress, lon, lat)
80+
errorOrigin = new ErrorOrigin(e.Report.RemoteAddress, lon, lat)
7581
{
7682
City = jsonObj["city"].ToString(),
7783
CountryCode = jsonObj["country_code"].ToString(),
@@ -80,13 +86,13 @@ public async Task HandleAsync(IMessageContext context, ReportAddedToIncident e)
8086
RegionName = jsonObj["region_name"].ToString(),
8187
ZipCode = jsonObj["zip"].ToString()
8288
};
83-
84-
await _repository.CreateAsync(cmd, e.Incident.ApplicationId, e.Incident.Id, e.Report.Id);
8589
}
8690
catch (Exception exception)
8791
{
88-
_logger.Error($"Failed to store location for incident {e.Incident.Id}/report {e.Report.Id}: {json}", exception);
92+
throw new InvalidOperationException($"Failed to call lookupService or parse the JSON: {json}.", exception);
8993
}
94+
95+
return errorOrigin;
9096
}
9197
}
9298
}

src/Server/Coderr.Server.ReportAnalyzer/Inbound/Handlers/Reports/ReportAnalyzer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public async Task Analyze(IMessageContext context, ErrorReportEntity report)
9090
incident = BuildIncident(report);
9191
_repository.CreateIncident(incident);
9292

93-
var evt = new IncidentCreated(incident.Id, incident.Description, incident.FullName)
93+
var evt = new IncidentCreated(incident.ApplicationId, incident.Id, incident.Description, incident.FullName)
9494
{
9595
ApplicationVersion = applicationVersion
9696
};

src/Server/Coderr.Server.SqlServer.Tests/Coderr.Server.SqlServer.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<PackageReference Include="xunit" Version="2.3.1" />
1919
<PackageReference Include="FluentAssertions" Version="5.2.0" />
2020
<PackageReference Include="NSubstitute" Version="3.1.0" />
21-
<PackageReference Include="DotNetCqs" Version="2.0.9" />
21+
<PackageReference Include="DotNetCqs" Version="2.0.10" />
2222
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
2323
</ItemGroup>
2424
<ItemGroup>

src/Server/Coderr.Server.SqlServer/Coderr.Server.SqlServer.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<AssemblyName>Coderr.Server.SqlServer</AssemblyName>
66
</PropertyGroup>
77
<ItemGroup>
8-
<PackageReference Include="DotNetCqs" Version="2.0.9" />
8+
<PackageReference Include="DotNetCqs" Version="2.0.10" />
99
<PackageReference Include="Griffin.Framework" Version="2.0.1" />
1010
<PackageReference Include="log4net" Version="2.0.8" />
1111
<PackageReference Include="Newtonsoft.Json" Version="11.0.1" />

0 commit comments

Comments
 (0)