From e586f2b9f6066723a7e836ad98efbb74901ce220 Mon Sep 17 00:00:00 2001 From: Andrew Binstock <920630+platypusguy@users.noreply.github.com> Date: Fri, 18 Aug 2023 21:10:54 -0700 Subject: [PATCH] JACOBIN-300 Added greater consistency to error message handling. --- src/jvm/run.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/jvm/run.go b/src/jvm/run.go index af32e22c..daf92724 100644 --- a/src/jvm/run.go +++ b/src/jvm/run.go @@ -943,9 +943,9 @@ func runFrame(fs *list.List) error { case IREM: // 0x70 (remainder after int division, modulo) val2 := pop(f).(int64) if val2 == 0 { - exceptions.Throw(exceptions.ArithmeticException, - "IREM: Arithmetic Exception: divide by zero") - return errors.New("IREM: Arithmetic Exception: divide by zero") + errMsg := "IREM: Arithmetic Exception: divide by zero" + exceptions.Throw(exceptions.ArithmeticException, errMsg) + return errors.New(errMsg) } else { val1 := pop(f).(int64) res := val1 % val2