-
-
Notifications
You must be signed in to change notification settings - Fork 119
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
Improve error handling in fj_export
#599
Conversation
6caf4de
to
4dd2700
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the follow-up, @chrisprice!
This looks excellent! I left some comments with suggestions, but this is some high-level complaining I'm doing there. No need to make any changes, but of course, another follow-up PR is welcome, if you're so inclined.
} | ||
None => Err(anyhow!("No extension specified")), | ||
Some(extension) => Err(Error::InvalidExtension( | ||
extension.to_str().map(|s| s.to_string()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Option<String>
in the error can make for a very confusing error message. How about changing it to String
, and using something like this here instead:
extension.to_str().map(|s| s.to_string()), | |
extension.to_string_lossy().into_owned(), |
#[error("no extension specified")] | ||
NoExtension, | ||
|
||
/// Unrecognised extension found `{0:?}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy-pasting the error message works for the other doc comments, but not this one 😁
/// Unrecognised extension found `{0:?}` | |
/// Unrecognised extension found |
Triangle::normal
/ Fix STL PR feedback
Hmm, I changed the PR title to highlight the addition of This is not a complaint about this pull request, I'm just explaining what I'm doing. Feel free to split future pull requests accordingly, if you happen to remember, but otherwise don't worry. Keeping track of this organization stuff is my job 😁 |
4dd2700
to
c1ed3f0
Compare
Triangle::normal
/ Fix STL PR feedbackfj_export
Rebased on top of #600. Merging. |
Thanks for the feedback on #594, I'm always keen to learn. This PR attempts to address the comments. Please feel free to keep the comments flowing!