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

#[class(inherit)] by default? #2

Open
dsherret opened this issue Dec 5, 2024 · 3 comments
Open

#[class(inherit)] by default? #2

dsherret opened this issue Dec 5, 2024 · 3 comments

Comments

@dsherret
Copy link
Member

dsherret commented Dec 5, 2024

Maybe this should be #[class(inherit)] by default?

#[derive(Debug, Error, JsError)]
pub enum FetchNoFollowErrorKind {
  #[class(inherit)] // don't require this?
  #[error(transparent)]
  ReadingFile(FailedReadingLocalFileError),
@crowlKats
Copy link
Member

I think this makes it too easy to accidentally miss setting the class, which given the situation with all these multiple macros, is quite easily missed

@dsherret
Copy link
Member Author

dsherret commented Dec 6, 2024

I was thinking this because I thought requiring it makes it too easy to accidentally override what the transparent error defines for its class. So it’s easy to end up in a scenario where the same error has different class names. Maybe it’s not possible to analyze for this in the macro though? It would maybe be nice for it to at least error when overriding a class name, but maybe not possible.

@crowlKats
Copy link
Member

yeah not really possible for it to be completely correct.
sadly we do have cases where we want to overwrite the error, so this wouldnt be desireable either way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants