Skip to content

Commit

Permalink
ProcessHelperExt: 输出未捕获的错误
Browse files Browse the repository at this point in the history
  • Loading branch information
imba-tjd committed Jun 16, 2023
1 parent 7373fec commit 4de0855
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion TextHookLibrary/ProcessHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public static string FindProcessPath(int pid, bool isx64game = false)
});
string output = p.StandardOutput.ReadToEnd();
if (p.ExitCode != 0)
throw new InvalidOperationException("Failed to execute ProcessHelperExt.exe");
throw new InvalidOperationException("Failed to execute ProcessHelperExt.exe\n" + p.StandardError.ReadToEnd());

string[] lines = output.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
foreach (string line in lines)
Expand Down
6 changes: 5 additions & 1 deletion Tools/ProcessHelperExt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@

return 0;
}
catch { return 2; }
catch (Exception e)
{
Console.Error.WriteLine(e);
return 2;
}

0 comments on commit 4de0855

Please sign in to comment.