Show / Hide Table of Contents

Class HarmonyException

Under Mono, HarmonyException wraps IL compile errors with detailed information about the failure

Inheritance
System.Object
System.Exception
HarmonyException
Namespace: HarmonyLib
Assembly: 0Harmony.dll
Syntax
[Serializable]
public class HarmonyException : Exception, ISerializable, _Exception

Constructors

| Improve this Doc View Source

HarmonyException(SerializationInfo, StreamingContext)

Default serialization constructor (not implemented)

Declaration
protected HarmonyException(SerializationInfo serializationInfo, StreamingContext streamingContext)
Parameters
Type Name Description
System.Runtime.Serialization.SerializationInfo serializationInfo

The info

System.Runtime.Serialization.StreamingContext streamingContext

The context

Methods

| Improve this Doc View Source

GetErrorIndex()

Get the index of the errornous IL instruction

Declaration
public int GetErrorIndex()
Returns
Type Description
System.Int32

The index into the list of instructions or -1 if not found

| Improve this Doc View Source

GetErrorOffset()

Get the error offset of the errornous IL instruction

Declaration
public int GetErrorOffset()
Returns
Type Description
System.Int32

The offset

| Improve this Doc View Source

GetInstructions()

Get a list of IL instructions without offsets

Declaration
public List<CodeInstruction> GetInstructions()
Returns
Type Description
System.Collections.Generic.List<CodeInstruction>

A list of CodeInstruction

| Improve this Doc View Source

GetInstructionsWithOffsets()

Get a list of IL instructions in pairs of offset+code

Declaration
public List<KeyValuePair<int, CodeInstruction>> GetInstructionsWithOffsets()
Returns
Type Description
System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.Int32, CodeInstruction>>

A list of key/value pairs which represent an offset and the code at that offset

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX