Skip to content

Commit

Permalink
improved result, log and error message handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Tammik committed Oct 10, 2014
1 parent 8abaa12 commit 8179844
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ System.Windows.Forms.IWin32Window revit_window
}

SynchronizationContext.SetSynchronizationContext(
syncContext );
syncContext );

// The gallery bucket

Expand Down Expand Up @@ -154,6 +154,10 @@ var modelResponse
+ " uploaded a new model to the gallery.\r\n"
+ "Your model is viewable at the following url:\r\n"
+ url;

Util.LogError( msg );

TaskDialog.Show( "Gallery Upload", msg );
}
}

Expand All @@ -170,13 +174,15 @@ public Result Execute(
{
message = "Sorry, this model has been modified. "
+ "Please resave before uploading.";
Util.LogError( message );
return Result.Failed;
}

if( doc.IsDetached )
{
message = "Sorry, this model is detached and "
+ "I cannot access the RVT file path.";
Util.LogError( message );
return Result.Failed;
}

Expand All @@ -185,6 +191,7 @@ public Result Execute(
message = "Please save the model to a file "
+ "before running this command, so I can "
+ "upload it.";
Util.LogError( message );
return Result.Failed;
}

Expand All @@ -198,7 +205,7 @@ public Result Execute(

Debug.Print( filename );

File.Copy( doc.PathName, filename );
File.Copy( doc.PathName, filename, true );

Debug.Assert( File.Exists( filename ),
"expected RVT file copy" );
Expand Down

0 comments on commit 8179844

Please sign in to comment.