File tree Expand file tree Collapse file tree 4 files changed +13
-20
lines changed
Shared/LastReferenceIdManager Expand file tree Collapse file tree 4 files changed +13
-20
lines changed Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using Exceptionless . Extras ;
3
- using Exceptionless . Logging ;
4
3
using Exceptionless . Models ;
5
4
6
5
namespace Exceptionless . Plugins {
7
6
[ Priority ( 30 ) ]
8
7
public class ErrorPlugin : IEventPlugin {
9
- private readonly IExceptionlessLog _log ;
10
-
11
- public ErrorPlugin ( IExceptionlessLog log ) {
12
- _log = log ;
13
- }
14
-
15
8
public void Run ( EventPluginContext context ) {
16
9
var exception = context . ContextData . GetException ( ) ;
17
10
if ( exception == null )
18
11
return ;
19
12
20
13
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 ) ;
22
15
}
23
16
}
24
17
}
Original file line number Diff line number Diff line change @@ -59,19 +59,19 @@ public void ClearLast() {
59
59
httpContext . Response . Cookies . Add ( cookie ) ;
60
60
}
61
61
62
- public void SetLast ( string errorId ) {
62
+ public void SetLast ( string eventId ) {
63
63
HttpContext httpContext = HttpContext . Current ;
64
64
if ( httpContext == null )
65
65
return ;
66
66
67
67
if ( httpContext . Session != null )
68
- httpContext . Session [ LAST_REFERENCE_ID_KEY ] = errorId ;
68
+ httpContext . Session [ LAST_REFERENCE_ID_KEY ] = eventId ;
69
69
70
70
// Session doesn't seem to be reliable so set it in a cookie as well.
71
71
try {
72
72
var cookie = new HttpCookie ( LAST_REFERENCE_ID_KEY ) ;
73
73
cookie . HttpOnly = true ;
74
- cookie . Value = errorId ;
74
+ cookie . Value = eventId ;
75
75
httpContext . Response . Cookies . Add ( cookie ) ;
76
76
} catch ( Exception e ) {
77
77
Log . Warn ( "Error setting reference id cookie: {0}" , e . Message ) ;
Original file line number Diff line number Diff line change @@ -22,9 +22,9 @@ public void ClearLast() {
22
22
/// <summary>
23
23
/// Sets the last event's reference id.
24
24
/// </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 ;
28
28
}
29
29
}
30
30
}
Original file line number Diff line number Diff line change 3
3
namespace Exceptionless {
4
4
public interface ILastReferenceIdManager {
5
5
/// <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.
7
7
/// </summary>
8
- /// <returns>The error id</returns>
8
+ /// <returns>The event id</returns>
9
9
string GetLast ( ) ;
10
10
11
11
/// <summary>
12
- /// Clears the last error id.
12
+ /// Clears the last event id.
13
13
/// </summary>
14
14
void ClearLast ( ) ;
15
15
16
16
/// <summary>
17
- /// Sets the last error id.
17
+ /// Sets the last event id.
18
18
/// </summary>
19
- /// <param name="errorId "></param>
20
- void SetLast ( string errorId ) ;
19
+ /// <param name="eventId "></param>
20
+ void SetLast ( string eventId ) ;
21
21
}
22
22
}
You can’t perform that action at this time.
0 commit comments