diff options
author | Charlie Stanton <charlie@shtanton.xyz> | 2023-04-19 13:47:09 +0100 |
---|---|---|
committer | Charlie Stanton <charlie@shtanton.xyz> | 2023-04-19 13:47:09 +0100 |
commit | 58d50737702adc48604f0a709080dcc587d7145f (patch) | |
tree | 76e56aef7470b2f89d2fe0450ad4a2014756303d /subex/arithmetic.go | |
parent | aea1a08d6a9d378137d467d3e1f1ccc40232b725 (diff) | |
download | stred-go-58d50737702adc48604f0a709080dcc587d7145f.tar |
Fixes internal error messages for arithmetic functions
Diffstat (limited to 'subex/arithmetic.go')
-rw-r--r-- | subex/arithmetic.go | 8 |
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 |