Skip to content

Commit f2267fc

Browse files
niemyjskiejsmith
andauthored
Improve Async stack traces, Improve Version Handling, Don't get Post Data on GETs, Update web pack (#236)
* Demystify exceptions * Change how we are getting app version. Don't include POST data for GET requests * Update messagepack, fix tests * Change how we get app version * Change how we are getting app version. Don't include POST data for GET requests * Fixed build warning on windows Co-authored-by: Eric J. Smith <[email protected]>
1 parent 3e10732 commit f2267fc

39 files changed

+2307
-178
lines changed

samples/Exceptionless.SampleWeb/Exceptionless.SampleWeb.csproj

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,6 @@
125125
<ItemGroup>
126126
<Folder Include="Properties\" />
127127
</ItemGroup>
128-
<ItemGroup>
129-
<ProjectReference Include="..\..\src\Platforms\Exceptionless.MessagePack\Exceptionless.MessagePack.csproj">
130-
<Project>{f7abd87a-2d84-4962-9a97-ec2f864cfa21}</Project>
131-
<Name>Exceptionless.MessagePack</Name>
132-
</ProjectReference>
133-
</ItemGroup>
134128
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
135129
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
136130
<ProjectExtensions>
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
// Copyright (c) Ben A Adams. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
4+
using System.Reflection;
5+
6+
namespace System.Diagnostics
7+
{
8+
public class EnhancedStackFrame : StackFrame
9+
{
10+
private string _fileName;
11+
private int _lineNumber;
12+
private int _colNumber;
13+
14+
public StackFrame StackFrame { get; }
15+
16+
public ResolvedMethod MethodInfo { get; }
17+
18+
internal EnhancedStackFrame(StackFrame stackFrame, ResolvedMethod methodInfo, string fileName, int lineNumber, int colNumber)
19+
: base(fileName, lineNumber, colNumber)
20+
{
21+
StackFrame = stackFrame;
22+
MethodInfo = methodInfo;
23+
24+
_fileName = fileName;
25+
_lineNumber = lineNumber;
26+
_colNumber = colNumber;
27+
}
28+
29+
/// <summary>
30+
/// Gets the column number in the file that contains the code that is executing.
31+
/// This information is typically extracted from the debugging symbols for the executable.
32+
/// </summary>
33+
/// <returns>The file column number, or 0 (zero) if the file column number cannot be determined.</returns>
34+
public override int GetFileColumnNumber() => _colNumber;
35+
36+
/// <summary>
37+
/// Gets the line number in the file that contains the code that is executing.
38+
/// This information is typically extracted from the debugging symbols for the executable.
39+
/// </summary>
40+
/// <returns>The file line number, or 0 (zero) if the file line number cannot be determined.</returns>
41+
public override int GetFileLineNumber() => _lineNumber;
42+
43+
/// <summary>
44+
/// Gets the file name that contains the code that is executing.
45+
/// This information is typically extracted from the debugging symbols for the executable.
46+
/// </summary>
47+
/// <returns>The file name, or null if the file name cannot be determined.</returns>
48+
public override string GetFileName() => _fileName;
49+
50+
/// <summary>
51+
/// Gets the offset from the start of the Microsoft intermediate language (MSIL)
52+
/// code for the method that is executing. This offset might be an approximation
53+
/// depending on whether or not the just-in-time (JIT) compiler is generating debugging
54+
/// code. The generation of this debugging information is controlled by the System.Diagnostics.DebuggableAttribute.
55+
/// </summary>
56+
/// <returns>The offset from the start of the MSIL code for the method that is executing.</returns>
57+
public override int GetILOffset() => StackFrame.GetILOffset();
58+
59+
/// <summary>
60+
/// Gets the method in which the frame is executing.
61+
/// </summary>
62+
/// <returns>The method in which the frame is executing.</returns>
63+
public override MethodBase GetMethod() => StackFrame.GetMethod();
64+
65+
/// <summary>
66+
/// Gets the offset from the start of the native just-in-time (JIT)-compiled code
67+
/// for the method that is being executed. The generation of this debugging information
68+
/// is controlled by the System.Diagnostics.DebuggableAttribute class.
69+
/// </summary>
70+
/// <returns>The offset from the start of the JIT-compiled code for the method that is being executed.</returns>
71+
public override int GetNativeOffset() => StackFrame.GetNativeOffset();
72+
73+
/// <summary>
74+
/// Builds a readable representation of the stack trace.
75+
/// </summary>
76+
/// <returns>A readable representation of the stack trace.</returns>
77+
public override string ToString() => MethodInfo.ToString();
78+
}
79+
}

0 commit comments

Comments
 (0)