diff --git a/parsley/shared/src/main/scala/parsley/internal/diagnostics.scala b/parsley/shared/src/main/scala/parsley/internal/diagnostics.scala index 5415c1ae3..e4660cf83 100644 --- a/parsley/shared/src/main/scala/parsley/internal/diagnostics.scala +++ b/parsley/shared/src/main/scala/parsley/internal/diagnostics.scala @@ -33,7 +33,9 @@ private [parsley] object RegisterOutOfBoundsException { // out of bounds register. case ste if ste.getMethodName == "apply" && ste.getClassName.startsWith("parsley.internal.machine.instructions") => - new CorruptedReferenceException + val err = new CorruptedReferenceException + err.addSuppressed(e) + err } case _ => None }