Skip to content

Commit 93fc637

Browse files
committed
Some cleanup.
1 parent d3747c3 commit 93fc637

File tree

4 files changed

+13
-20
lines changed

4 files changed

+13
-20
lines changed

Source/Extras/Plugins/ErrorPlugin.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,17 @@
11
using System;
22
using Exceptionless.Extras;
3-
using Exceptionless.Logging;
43
using Exceptionless.Models;
54

65
namespace Exceptionless.Plugins {
76
[Priority(30)]
87
public class ErrorPlugin : IEventPlugin {
9-
private readonly IExceptionlessLog _log;
10-
11-
public ErrorPlugin(IExceptionlessLog log) {
12-
_log = log;
13-
}
14-
158
public void Run(EventPluginContext context) {
169
var exception = context.ContextData.GetException();
1710
if (exception == null)
1811
return;
1912

2013
context.Event.Type = Event.KnownTypes.Error;
21-
context.Event.Data[Event.KnownDataKeys.Error] = exception.ToErrorModel(_log);
14+
context.Event.Data[Event.KnownDataKeys.Error] = exception.ToErrorModel(context.Log);
2215
}
2316
}
2417
}

Source/Platforms/Web/WebLastReferenceIdManager.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,19 @@ public void ClearLast() {
5959
httpContext.Response.Cookies.Add(cookie);
6060
}
6161

62-
public void SetLast(string errorId) {
62+
public void SetLast(string eventId) {
6363
HttpContext httpContext = HttpContext.Current;
6464
if (httpContext == null)
6565
return;
6666

6767
if (httpContext.Session != null)
68-
httpContext.Session[LAST_REFERENCE_ID_KEY] = errorId;
68+
httpContext.Session[LAST_REFERENCE_ID_KEY] = eventId;
6969

7070
// Session doesn't seem to be reliable so set it in a cookie as well.
7171
try {
7272
var cookie = new HttpCookie(LAST_REFERENCE_ID_KEY);
7373
cookie.HttpOnly = true;
74-
cookie.Value = errorId;
74+
cookie.Value = eventId;
7575
httpContext.Response.Cookies.Add(cookie);
7676
} catch (Exception e) {
7777
Log.Warn("Error setting reference id cookie: {0}", e.Message);

Source/Shared/LastReferenceIdManager/DefaultLastReferenceIdManager.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ public void ClearLast() {
2222
/// <summary>
2323
/// Sets the last event's reference id.
2424
/// </summary>
25-
/// <param name="errorId"></param>
26-
public void SetLast(string errorId) {
27-
_lastReferenceId = errorId;
25+
/// <param name="eventId"></param>
26+
public void SetLast(string eventId) {
27+
_lastReferenceId = eventId;
2828
}
2929
}
3030
}

Source/Shared/LastReferenceIdManager/ILastReferenceIdManager.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
namespace Exceptionless {
44
public interface ILastReferenceIdManager {
55
/// <summary>
6-
/// Gets the last error id that was submitted to the server.
6+
/// Gets the last event id that was submitted to the server.
77
/// </summary>
8-
/// <returns>The error id</returns>
8+
/// <returns>The event id</returns>
99
string GetLast();
1010

1111
/// <summary>
12-
/// Clears the last error id.
12+
/// Clears the last event id.
1313
/// </summary>
1414
void ClearLast();
1515

1616
/// <summary>
17-
/// Sets the last error id.
17+
/// Sets the last event id.
1818
/// </summary>
19-
/// <param name="errorId"></param>
20-
void SetLast(string errorId);
19+
/// <param name="eventId"></param>
20+
void SetLast(string eventId);
2121
}
2222
}

0 commit comments

Comments
 (0)