Open Banane9 opened 6 months ago
Transpiler are chained and their results is collected, then logged. If an exceptions occurs in a transpiler there is no result yet. Which means there is nothing to log.
If an exceptions occurs in a transpiler there is no result yet.
But there is no exception in the transpiler - the exception occurs in Cecil when Harmony tries to "compile" the CodeInstructions back into a replacement method. But it looks like the logging only occurs after that step, which makes it hard to tell what the problem with the IL was.
Describe the bug When using the [HarmonyDebug] attributes or setting
Harmony.DEBUG = true
, the replacement's IL should be logged to the Harmony.log.txt file. However, when the construction of the method fails because of Cecil, no replacement IL is logged.To Reproduce
Expected behavior The IL constructed for the replacement should always be logged, before it is finalized with Cecil and potentially fails to log.
Screenshots / Code See Reproduction.
Runtime environment (please complete the following information):
Additional context Discussion in discord starting here: https://discord.com/channels/131466550938042369/361891646742462467/1215048908628299787