Commit Graph

11 Commits

Author SHA1 Message Date
Qi Xiao
27f6ab2aa1 pkg/eval/errs: Fix misleading message in OutOfRange.Error.
The method returns a message saying that there is no valid value if ValidHigh <
ValidLow. This was useful when these fields were numbers, but since they are now
strings this no longer works.
2022-11-20 15:11:57 +00:00
Shengjing Zhu
5724ec4c47 Fix typos and add codespell to CI 2021-08-22 23:07:34 +01:00
Qi Xiao
321a4e78eb Merge branch 'master' into reader-gone 2021-06-15 22:09:40 +01:00
Kurtis Rader
9a576529a3 Replace ErrArgs with more specific errors
This also replaces the slightly awkward "arguments here" reason with
"argument count" as the "what" for a typical errs.ArityMismatch
exception. It also reformats most of the constructors so that the "what"
is on the same line. This makes `grep errs.ArityMismatch **.go` more
useful as a result.
2021-06-13 22:42:04 +01:00
Qi Xiao
fd70a5a274 pkg/eval/errs: Add ReaderGone error type.
Also fix the error message of SetReadOnlyVar.
2021-05-18 20:34:44 +01:00
Qi Xiao
7b66e9f104 Minor fixups for #1273.
Also fix a test broken by bad merge.
2021-05-02 00:13:22 +01:00
Kurtis Rader
1e0885310e Include name in error msg setting a readonly var
When attempting to update a read-only var return an error struct rather
than a simple string (i.e., a Go `error` type).  This makes it possible
to include the var name in the error message.  This builds on commit
a33ecb2d that highlights the offending var name in the stack trace but
does not include the var name in the error message. With this change the
error message includes the offending var name.

Related #255
2021-03-26 18:38:22 -07:00
Qi Xiao
821e414fc9 pkg/eval/errs: Change OutOfRange.Valid{Low High} to strings. 2020-08-18 21:23:26 +01:00
Kurtis Rader
da16162cc8 Increase umask code coverage from 62% to 100%
Related #1062
2020-08-18 21:13:27 +01:00
Qi Xiao
64e282c828 pkg/eval: Replace ValuesUnwrapper with simple functions.
Also add structured BadValue error type to pkg/eval/errs.
2020-04-13 13:27:55 +01:00
Qi Xiao
56e36ad77e pkg/eval: Add and use a structured OutOfRange error type.
This commit introduces new pkg/eval/errs package, where structured error types
will be added.
2020-04-12 19:12:05 +01:00