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

Emit good error message, if model doesn't define model function #848

Closed
hannobraun opened this issue Jul 20, 2022 · 0 comments · Fixed by #1276
Closed

Emit good error message, if model doesn't define model function #848

hannobraun opened this issue Jul 20, 2022 · 0 comments · Fixed by #1276
Labels
type: feature New features and improvements to existing features

Comments

@hannobraun
Copy link
Owner

As of now, when loading a model that doesn't define a model function, this is what happens:

thread 'main' panicked at 'Error reloading model: LibLoading(DlSym { desc: "target/debug/liberror.so: undefined symbol: model" })', crates/fj-host/src/lib.rs:279:25
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

This should result in a good error message that explains what's wrong and how to fix it. The way to fix this, is to define a model function in the model's lib.rs:

#[fj::model]
pub fn model() -> fj::Shape {
    // ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature New features and improvements to existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant