fix(expression): add validation for empty expression list in CEL (#545)
* fix(expression): add validation for empty ExpressionOrList Signed-off-by: Jason Cameron <git@jasoncameron.dev> * fix(imports): block empty file imports with improved error checking logic Signed-off-by: Jason Cameron <git@jasoncameron.dev> * docs(expression): improve validation to error on empty CEL expressions Signed-off-by: Jason Cameron <git@jasoncameron.dev> --------- Signed-off-by: Jason Cameron <git@jasoncameron.dev>
This commit is contained in:
parent
51f875ff6f
commit
93e2447ba2
4 changed files with 12 additions and 1 deletions
|
|
@ -224,7 +224,7 @@ func (is *ImportStatement) open() (fs.File, error) {
|
|||
func (is *ImportStatement) load() error {
|
||||
fin, err := is.open()
|
||||
if err != nil {
|
||||
return fmt.Errorf("can't open %s: %w", is.Import, err)
|
||||
return fmt.Errorf("%w: %s: %w", ErrInvalidImportStatement, is.Import, err)
|
||||
}
|
||||
defer fin.Close()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue