Skip to content

Commit

Permalink
Fix error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Wilms committed Dec 30, 2024
1 parent eb73199 commit 3ee737e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,13 @@ DatatypeMessageClass.VariableLength when ((VariableLengthBitFieldDescription)Bit
? memoryType is null
? (typeof(byte[]), GetDecodeInfoForOpaqueAsByteArray())
: (memoryType, GetDecodeInfoForUnmanagedElement(memoryType))
: throw new Exception($"Bitfield data can only be decoded into types that match the struct constraint of the same size (incompatible type: {memoryType})."),
: throw new Exception($"Opaque data can only be decoded into types that match the struct constraint of the same size (incompatible type: {memoryType})."),

/* reference */
DatatypeMessageClass.Reference =>
memoryType is null || memoryType == typeof(NativeObjectReference1)
? (typeof(NativeObjectReference1), GetDecodeInfoForUnmanagedElement<NativeObjectReference1>())
: throw new Exception($"Bitfield data can only be decoded as NativeObjectReference1 (incompatible type: {memoryType})."),
: throw new Exception($"Reference data can only be decoded as NativeObjectReference1 (incompatible type: {memoryType})."),

/* default */
_ => throw new NotSupportedException($"The class '{Class}' is not supported.")
Expand Down

0 comments on commit 3ee737e

Please sign in to comment.