fix: recover uncertain native failures and reopen long project paths safely

This commit is contained in:
阿白叔 committed 2026-10-15 17:49:10 +08:00
1 parent 7f0ec29d31
commit d832a1c736
15 files changed
+355 -36

No files matched your search

@@ -591,6 +591,7 @@ End Function
Sub QPEnsureProject(ByRef App, ByVal TargetPath)
Dim ProjectData, CurrentPath, Opened, View, Documents
Dim Schematics, Schematic, Sheets, Sheet, SheetCount, OnlySchematic, OnlySheet, Document
TargetPath = QPProjectAccessPath(TargetPath)
If Not QP_Fso.FileExists(TargetPath) Then _
Err.Raise vbObjectError + 850, "QuickPartReplace.Session", "confirmed project file does not exist: " & TargetPath
QP_Stage = "check_project"
@@ -1002,6 +1003,7 @@ Sub QPNativeReplace(ByRef Command, ByVal SnapshotPath)
QP_NativeCallActive = True
QPProgress "native_replace", 0, 1
ExitCode = Shell.Run(CommandLine, 0, True)
QPLog QP_Root, "INFO", "native_helper_exit code=" & CStr(ExitCode)
QP_NativeMutationPossible = QPNativeReportShowsMutation(SnapshotPath & ".native.json")
QP_NativeCallActive = False
QPInvalidatePinIndex
@@ -1016,7 +1018,7 @@ Sub QPNativeReplace(ByRef Command, ByVal SnapshotPath)
"; report: " & SnapshotPath & ".native.json"
Else
Err.Raise vbObjectError + 839, "QuickPartReplace", _
"automatic native replacement failed; see " & SnapshotPath & ".native.json"
"automatic native replacement failed (exit=" & CStr(ExitCode) & "); see " & SnapshotPath & ".native.json"
End If
End If
End Sub