<- Back to shtanton's homepage
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharlie Stanton <charlie@shtanton.xyz>2023-04-19 13:47:09 +0100
committerCharlie Stanton <charlie@shtanton.xyz>2023-04-19 13:47:09 +0100
commit58d50737702adc48604f0a709080dcc587d7145f (patch)
tree76e56aef7470b2f89d2fe0450ad4a2014756303d
parentaea1a08d6a9d378137d467d3e1f1ccc40232b725 (diff)
downloadstred-go-58d50737702adc48604f0a709080dcc587d7145f.tar
Fixes internal error messages for arithmetic functions
-rw-r--r--subex/arithmetic.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/subex/arithmetic.go b/subex/arithmetic.go
index 5497a68..ff30a58 100644
--- a/subex/arithmetic.go
+++ b/subex/arithmetic.go
@@ -73,10 +73,10 @@ func multiplyValues(atoms []walk.Atom) ([]walk.Atom, error) {
if err == nil {
product *= num
} else {
- return nil, errors.New("Tried to sum non-castable string")
+ return nil, errors.New("Tried to multiply non-castable string")
}
default:
- return nil, errors.New("Tried to sum non-number")
+ return nil, errors.New("Tried to multiply non-number")
}
}
if allBools {
@@ -110,10 +110,10 @@ func negateValues(atoms []walk.Atom) ([]walk.Atom, error) {
if err == nil {
negatedNumbers = append(negatedNumbers, walk.ValueNumber(-num))
} else {
- return nil, errors.New("Tried to sum non-castable string")
+ return nil, errors.New("Tried to negate non-castable string")
}
default:
- return nil, errors.New("Tried to sum non-number")
+ return nil, errors.New("Tried to negate non-number")
}
}
return negatedNumbers, nil