Skip to content

Commit

Permalink
Merge pull request #137 from bugsnag/next
Browse files Browse the repository at this point in the history
Release v2.2.2
  • Loading branch information
yousif-bugsnag committed Mar 18, 2021
2 parents ca4a2d3 + 8009697 commit 703bba1
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 56 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
Changelog
=========

## 2.2.1 (2019-05-14)
## 2.2.2 (2021-03-18)

### Bug fixes

* Stop sending code snippets in error reports.
| [yousif-bugsnag](https://github.com/yousif-bugsnag)
| [#134](https://github.com/bugsnag/bugsnag-dotnet/pull/134)

* Assume default behaviour for UnobservedTaskExceptions when App.config does not exist.
| [yousif-bugsnag](https://github.com/yousif-bugsnag)
| [#135](https://github.com/bugsnag/bugsnag-dotnet/pull/135)

## 2.2.1 (2020-05-14)

### Bug fixes

Expand Down
45 changes: 0 additions & 45 deletions src/Bugsnag/Payload/Code.cs

This file was deleted.

9 changes: 2 additions & 7 deletions src/Bugsnag/Payload/StackTraceLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,21 +83,16 @@ public static StackTraceLine FromStackFrame(StackFrame stackFrame)
var lineNumber = stackFrame.GetFileLineNumber();
var methodName = new Method(method).DisplayName();
var inProject = false;
var code = new Code(stackFrame, 5).Display();

return new StackTraceLine(file, lineNumber, methodName, inProject, code);
return new StackTraceLine(file, lineNumber, methodName, inProject);
}

public StackTraceLine(string file, int lineNumber, string methodName, bool inProject, Dictionary<string, string> code)
public StackTraceLine(string file, int lineNumber, string methodName, bool inProject)
{
this.AddToPayload("file", file);
this.AddToPayload("lineNumber", lineNumber);
this.AddToPayload("method", methodName);
this.AddToPayload("inProject", inProject);
if (code != null && code.Count > 0)
{
this.AddToPayload("code", code);
}
}

public string FileName
Expand Down
5 changes: 4 additions & 1 deletion src/Bugsnag/UnhandledException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ private bool DetermineUnobservedTerminates()
#if NET35 || NET40
return true;
#elif NET45
System.Xml.Linq.XElement configFile = System.Xml.Linq.XElement.Load(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile);
System.Xml.Linq.XElement configFile = null;
if(System.IO.File.Exists(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile))
configFile = System.Xml.Linq.XElement.Load(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile);

var configValue = configFile?.Element("runtime")?.Element("ThrowUnobservedTaskExceptions")?.Attribute("enabled")?.Value;
bool value;
var success = bool.TryParse(configValue, out value);
Expand Down
4 changes: 2 additions & 2 deletions tests/Bugsnag.Tests/MiddlewareTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void ProjectRootStrippingTests(string[] projectRoots, string fileName, st

foreach (var exception in report.Event.Exceptions)
{
var stacktrace = new StackTraceLine[] { new StackTraceLine(fileName, 1, string.Empty, false, null) };
var stacktrace = new StackTraceLine[] { new StackTraceLine(fileName, 1, string.Empty, false) };
exception["stacktrace"] = stacktrace;
}

Expand Down Expand Up @@ -95,7 +95,7 @@ public void InProjectTest(string[] projectNamespaces, StackTraceInProjectTestCas
foreach (var exception in report.Event.Exceptions)
{
exception["stacktrace"] = testCases
.Select(t => new StackTraceLine(null, 0, t.MethodName, false, null))
.Select(t => new StackTraceLine(null, 0, t.MethodName, false))
.ToArray();
}

Expand Down

0 comments on commit 703bba1

Please sign in to comment.