Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - add some info from ReflectPathError to the error messages #5626

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions crates/bevy_reflect/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ use thiserror::Error;
/// An error returned from a failed path string query.
#[derive(Debug, PartialEq, Eq, Error)]
pub enum ReflectPathError<'a> {
#[error("expected an identifier at the given index")]
#[error("expected an identifier at index {index}")]
ExpectedIdent { index: usize },
#[error("the current struct doesn't have a field with the given name")]
#[error("the current struct doesn't have a field with the name `{field}`")]
InvalidField { index: usize, field: &'a str },
#[error("the current tuple struct doesn't have a field with the given index")]
#[error("the current tuple struct doesn't have a field with the index {tuple_struct_index}")]
InvalidTupleStructIndex {
index: usize,
tuple_struct_index: usize,
},
#[error("the current list doesn't have a value at the given index")]
#[error("the current list doesn't have a value at the index {list_index}")]
InvalidListIndex { index: usize, list_index: usize },
#[error("encountered an unexpected token")]
#[error("encountered an unexpected token `{token}`")]
UnexpectedToken { index: usize, token: &'a str },
#[error("expected a token, but it wasn't there.")]
#[error("expected token `{token}`, but it wasn't there.")]
ExpectedToken { index: usize, token: &'a str },
#[error("expected a struct, but found a different reflect value")]
ExpectedStruct { index: usize },
Expand Down