-
Notifications
You must be signed in to change notification settings - Fork 635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crash report fixes #15147
crash report fixes #15147
Changes from 1 commit
41aa117
63e1b5d
f474446
3c37ceb
068adc2
1bcce09
928e049
1c92594
b61e60d
8dfb8be
1e2b79c
cb74175
a15b2d3
570c1e9
0272a11
1fd5bbf
243787d
0659d76
890984f
cf9aff5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -839,6 +839,18 @@ private void CrashGracefully(Exception ex, bool fatal = false) | |
{ | ||
try | ||
{ | ||
if (!fatal) | ||
{ | ||
var localPkg = Model.GetPackageManagerExtension()?.PackageLoader?.LocalPackages?.FirstOrDefault(p => p.LoadedAssemblies.FirstOrDefault(a => a.Name == ex.Source) != null); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. might happen that one of these package assemblies is already loaded by dynamo (as a dependency), so we could potentially continue running even though the exception is coming from somewhere else. (not the pacakge we identified) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At the moment this code will always continue the session and only log the exception. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
hmm, so in most cases this will work. Have you verified that this property is set to the short name or full name of the assembly? Does it include the version number and culture? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what about the edge case where a user has shipped system binaries (Microsoft) or Dynamo binaries? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea, I can verify if the assemblies have been loaded already, probably at a small performance penalty There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor: does it still make sense to have this check (code path) in the same function ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CrashGracefully is called from multiple places. |
||
if (localPkg != null) | ||
{ | ||
var crashDetails = new CrashErrorReportArgs(ex); | ||
Model?.Logger?.LogError($"Unhandled exception coming from package {localPkg.Name} was handled: {crashDetails.Details}"); | ||
Analytics.TrackException(ex, true); | ||
pinzart90 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return; | ||
} | ||
} | ||
|
||
DynamoModel.IsCrashing = true; | ||
var crashData = new CrashErrorReportArgs(ex); | ||
Model?.Logger?.LogError($"Unhandled exception: {crashData.Details} "); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit pick - use var
also pattern match
is
would be nice with an if statement for the second line.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean like so ?