Skip to content
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

[DNM] Remove Dispatcher unhandled exception handler since it's already handled in DynamoCore #3029

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions src/DynamoRevit/DynamoRevit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1031,19 +1031,19 @@ public static string GetRevitContext(DynamoRevitCommandData commandData)
private static void Dispatcher_UnhandledException(
object sender, DispatcherUnhandledExceptionEventArgs args)
{
args.Handled = true;

// only handle a single crash per Dynamo sesh, this should be reset in the initial command
// only handle a single crash per Dynamo session, this should be reset in the initial command
if (handledCrash)
return;

handledCrash = true;

string exceptionMessage = args.Exception.Message;

try
{
Dynamo.Logging.Analytics.TrackException(args.Exception, true);
if (!args.Handled)
{
Analytics.TrackException(args.Exception, true);
}
string exceptionMessage = args.Exception.Message;

RevitDynamoModel.Logger.LogError("Dynamo Unhandled Exception");
RevitDynamoModel.Logger.LogError(exceptionMessage);
Expand All @@ -1052,11 +1052,12 @@ private static void Dispatcher_UnhandledException(

try
{
DynamoModel.IsCrashing = true;
RevitDynamoModel.OnRequestsCrashPrompt(
RevitDynamoModel,
new CrashPromptArgs(args.Exception.Message + "\n\n" + args.Exception.StackTrace));
RevitDynamoViewModel.Exit(false); // don't allow cancellation
if (!args.Handled)
{
DynamoModel.IsCrashing = true;
RevitDynamoModel.OnRequestsCrashPrompt(new CrashErrorReportArgs(args.Exception));
RevitDynamoViewModel.Exit(false); // don't allow cancellation
}
aparajit-pratap marked this conversation as resolved.
Show resolved Hide resolved
}
catch { }
finally
Expand Down