Avoid sending exception for an invalid keypath, instead returning an error