From 3bdd1ac8b316524f01935574602f744b6acffe4e Mon Sep 17 00:00:00 2001 From: James Nugent Date: Mon, 25 Jan 2016 10:21:12 -0600 Subject: [PATCH] core: Display invalid type in error message If a variable type which is invalid (e.g. "stringg") is declared, we now include the invalid type description in the error message to make it easier to track down the source of the error in the source file. --- config/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.go b/config/config.go index 2200325852..bb3f5f1c8a 100644 --- a/config/config.go +++ b/config/config.go @@ -807,7 +807,7 @@ func (v *Variable) ValidateTypeAndDefault() error { // If an explicit type is declared, ensure it is valid if v.DeclaredType != "" { if _, ok := typeStringMap[v.DeclaredType]; !ok { - return fmt.Errorf("Variable '%s' must be of type string or map", v.Name) + return fmt.Errorf("Variable '%s' must be of type string or map - '%s' is not a valid type", v.Name, v.DeclaredType) } }