better error message for snippet