mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-12 19:32:48 -06:00
Use a better error message when trying to merge non-objects (#6805)
Fixes #6803 Signed-off-by: Anders Eknert <anders@styra.com>
This commit is contained in:
+1
-1
@@ -41,7 +41,7 @@ func (e *Errors) add(err error) {
|
||||
type unsupportedDocumentType string
|
||||
|
||||
func (path unsupportedDocumentType) Error() string {
|
||||
return string(path) + ": bad document type"
|
||||
return string(path) + ": document must be of type object"
|
||||
}
|
||||
|
||||
type unrecognizedFile string
|
||||
|
||||
@@ -732,7 +732,7 @@ func TestLoadErrors(t *testing.T) {
|
||||
}
|
||||
|
||||
expected := []string{
|
||||
"bad_doc.json: bad document type",
|
||||
"bad_doc.json: document must be of type object",
|
||||
"a.json: EOF",
|
||||
"b.yaml: error converting YAML to JSON",
|
||||
"empty.rego:0: rego_parse_error: empty module",
|
||||
|
||||
Reference in New Issue
Block a user