-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: use serde_path_to_error for better parsing errors #13
Conversation
FWIW cargo also told me that |
4f9dcdf
to
6d4a7f7
Compare
That one was relatively important. There are different kinds of errors that this function may return. There might be a parsing error that we want to improve the error message for, but there might also be a server-side error, for example if we provide an invalid token. The To make sure that server-side error messages are also properly parsed, I have amended your commit to manually try to deserialize errors. It performs to my expectations in my tests. Does this look good to you?
That's good! 👍 |
Co-authored-by: Martin Kröning <[email protected]>
6d4a7f7
to
cf2a2bc
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.
Thanks!
No worries! Are you going to update the AUR packages once you've created a new release? (I saw that you are the maintainer on the AUR) |
Good question. I have also thought about that recently. I am not using Arch myself anymore, that's why I don't really maintain that package anymore. I was considering removing it from the README and orphaning the package. Are you interested in maintaining the package? I could, of course, bump the versions myself occasionally, but without proper testing or using the package I am not sure if that is beneficial. |
@mkroening Sure, why not! I think it's also possible to add co maintainers, this way I wouldn't be solely responsible, and you could still have the power over the package. I couldn't really find how to do this, but on the AUR frontpage it says "Co-Maintained Packages" which currently are none, so it should be somehow possible. Okay I think It's on the Package Page once you're logged in there is a button called 'Manage Co-Maintainers' in the 'Package Actions' section. |
Awesome! I have just published version 0.2.3 on GitHub and added you as co-maintainer for both packages in the AUR. :) |
@mkroening Perfect! I suppose the dbus dependency isn't needed anymore? At least I can't find any mentions of it in edu-sync anymore? If I saw it correctly, this was used for keyring functionallity, which was removed and the token stored into the config |
Yes, that's correct. 👍 |
I hoped it would be just a quick version bump, but somehow it doesn't compile the Compiling v0.2.3 manually works completely fine, but somehow not through makepkg via the PKGBUILD. Don't know if this is an issue with my setup, will need to look into this tomorrow. |
@mkroening Okay, don't know what the core issue really is, but it's related to briansmith/ring#1444 Some other things I noticed (while debugging the linking error), the I also noticed that some modules are specified in different crates with different feature flags, especially reqwest and tokio. I'm not that proficient in rust, but if I understand it correctly, this increases the compile time, as it needs to compile tokio and reqwest 4 times. Both are not blocking me from updating the AUR packages, just wanted to mention it. Done, have updated the versions, and at least it installed with |
The parsing errors now use the serde_path_to_error library as I proposed in #11
I'm not too sure on two things:
I didn't need (i.e. I couldn't get it working with it, and wasn't too sure what it's use case was with serde) the UntaggedEnumHelper anymore, maybe you can take a look at this if this is correct.
I moved printing the response from the
error!
statement to adebug!
statement for two reasons:serde_path_to_error
is already descriptive enough: e.g. for the issue that I fixed in fix: module indent can be negative #11 It would look like this:Could not deserialize response err=Error { path: Path { segments: [Seq { index: 6 }, Map { key: "modules" }, Seq { index: 7 }, Map { key: "indent" }] }, original: Error("invalid value: integer `-1`, expected u64", line: 1, column: 35913) }
This fixes #14