Skip to content

Commit 5a3eaff

Browse files
committed
Make error messages more clear
1 parent 952230b commit 5a3eaff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

restapi/common.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func GetObjectAtKey(data map[string]interface{}, path string, debug bool) (inter
125125
}
126126
} else {
127127
if debug { log.Printf("common.go:GetObjectAtKey: %s - MISSING", part) }
128-
return nil, fmt.Errorf("GetObjectAtKey: Failed to find %s in returned data structure after finding '%s'. Available: %s", part, seen, strings.Join(GetKeys(hash), ","))
128+
return nil, fmt.Errorf("GetObjectAtKey: Failed to find '%s' in returned data structure after finding '%s'. Available: %s", part, seen, strings.Join(GetKeys(hash), ","))
129129
}
130130
} /* End Loop through parts */
131131

@@ -135,7 +135,7 @@ func GetObjectAtKey(data map[string]interface{}, path string, debug bool) (inter
135135
if debug {
136136
log.Printf("common.go:GetObjectAtKey: %s - MISSING (available: %s)", part, strings.Join(GetKeys(hash), ","))
137137
}
138-
return nil, fmt.Errorf("GetObjectAtKey: Resulting map at %s does not have key %s. Available: %s", seen, part, strings.Join(GetKeys(hash), ","))
138+
return nil, fmt.Errorf("GetObjectAtKey: Resulting map at '%s' does not have key '%s'. Available: %s", seen, part, strings.Join(GetKeys(hash), ","))
139139
}
140140

141141
if debug { log.Printf("common.go:GetObjectAtKey: %s - exists", part) }

0 commit comments

Comments
 (0)