-
Notifications
You must be signed in to change notification settings - Fork 10
stability improvement #10
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
base: main
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
|
|
@@ -3,17 +3,16 @@ | |
|
|
||
| namespace ArabicaCliento.Patches; | ||
|
|
||
| [HarmonyPatch] | ||
| [HarmonyPatch("Robust.Client.Console.ClientConsoleHost", "CanExecute")] | ||
| internal class ConsoleHostPatch | ||
| { | ||
| [HarmonyTargetMethod] | ||
| private static MethodBase TargetMethod() | ||
| { | ||
| return AccessTools.Method(AccessTools.TypeByName("Robust.Client.Console.ClientConsoleHost"), | ||
| "CanExecute"); | ||
|
|
||
| } | ||
|
|
||
| [HarmonyPostfix] | ||
| private static void Postfix(ref bool __result) => __result = true; | ||
|
|
||
|
|
||
| [HarmonyFinalizer] | ||
| private static void Finalizer(Exception __exception) | ||
| { | ||
| MarseyLogger.Fatal($"Error while patching ConsoleHostPatch: {__exception}"); | ||
|
Comment on lines
+13
to
+16
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. issue (bug_risk): Finalizer logs all exceptions, which may mask original errors. Logging without rethrowing may suppress important exceptions and hide bugs. Consider rethrowing after logging or handling only specific exceptions. |
||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,8 +6,14 @@ namespace ArabicaCliento.Patches; | |
| internal static class DrawOcclusionDepthPatch | ||
| { | ||
| [HarmonyPrefix] | ||
| static bool Prefix() | ||
| private static bool Prefix() | ||
| { | ||
| return !ArabicaConfig.FOVDisable; | ||
| } | ||
|
|
||
| [HarmonyFinalizer] | ||
| private static void Finalizer(Exception __exception) | ||
| { | ||
| MarseyLogger.Fatal($"Error while patching DrawOcclusionDepthPatch: {__exception}"); | ||
|
Comment on lines
+14
to
+17
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. issue (bug_risk): Finalizer logs exceptions but does not handle or rethrow them. Consider rethrowing the exception after logging to prevent silent failures and ensure errors are not masked. |
||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,7 @@ | |
| namespace ArabicaCliento.Patches; | ||
|
|
||
| [HarmonyPatch(typeof(GunSystem), nameof(GunSystem.Update))] | ||
| public class GunUpdatePatch | ||
| internal class GunUpdatePatch | ||
| { | ||
| private static EntityManager? _entMan; | ||
| private static IInputManager? _input; | ||
|
|
@@ -57,4 +57,10 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi | |
|
|
||
| return codes.AsEnumerable(); | ||
| } | ||
|
|
||
| [HarmonyFinalizer] | ||
| private static void Finalizer(Exception __exception) | ||
| { | ||
| MarseyLogger.Fatal($"Error while patching GunUpdatePatch: {__exception}"); | ||
|
Comment on lines
+61
to
+64
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. issue (bug_risk): Finalizer logs exceptions but does not rethrow. Evaluate if rethrowing exceptions after logging is necessary to ensure important errors are not silently ignored. |
||
| } | ||
| } | ||
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.
issue (bug_risk): Finalizer logs exceptions but does not rethrow.
Suppressing exceptions in the finalizer may conceal errors. Consider rethrowing after logging if needed.