From af2436d7cc555216526052b901583c0e75dddb24 Mon Sep 17 00:00:00 2001 From: Bruce Wells Date: Mon, 27 Aug 2018 17:47:28 -0400 Subject: Exception Messages Basically the token that is causing the exception for better diagnostics. --- src/NXP/Classes/Calculator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/NXP/Classes/Calculator.php') diff --git a/src/NXP/Classes/Calculator.php b/src/NXP/Classes/Calculator.php index 41e0d9f..b584d69 100644 --- a/src/NXP/Classes/Calculator.php +++ b/src/NXP/Classes/Calculator.php @@ -40,7 +40,7 @@ class Calculator if ($token instanceof TokenVariable) { $variable = $token->getValue(); if (!array_key_exists($variable, $variables)) { - throw new UnknownVariableException(); + throw new UnknownVariableException($variable); } $value = $variables[$variable]; array_push($stack, new TokenNumber($value)); -- cgit v1.2.3