-
Notifications
You must be signed in to change notification settings - Fork 154
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
Authentication #37
Authentication #37
Conversation
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.
It looks good, but I'm really concerned with the tracer macros. I feel like there could be a way better system for it, and adding it to every function in the library seems pretty annoying
/// To run this, you need to first spawn this function as a task, then | ||
/// open a browser to the given URL and finally wait on the spawned future | ||
/// with the ability to cancel in case the browser is closed before finishing | ||
#[tracing::instrument] |
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.
are these macros needed everywhere with this lib?
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.
Only on functions which need to be known about in the spantrace. Unfortunately, since async Rust doesn't have any real consistent stack to trace usefully, we need to use the macro to determine where we are in actual control flow.
#[derive(thiserror::Error, Debug)] | ||
pub enum Error { | ||
pub enum ErrorKind { |
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.
What's the purpose of this name change? Most Rust libs use Error
, and I think we should stick to that
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.
It is now integrated into the actual error type, which captures it and a spantrace so it can be traced back further than where application code is invoked.
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.
If there were a better solution for async, the authors of the Tokio runtime probably would have used it as the main way to trace errors in their own runtime (after all, Tokio is the one who authored the tracing library and is using it in their console debugger).
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.
IMO the old Error should be called Error
because it's the direct library error. The other error should be TracableError
or something of the sorts
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.
Actually, everywhere uses this kind of convention, backtraces are captured using a similar pattern usually.
@@ -52,4 +69,35 @@ pub enum Error { | |||
OtherError(String), | |||
} | |||
|
|||
#[derive(Debug)] | |||
pub struct Error { |
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.
What's the purpose of this name change? Most Rust libs use
Error
, and I think we should stick to that
@Geometrically - This is the new error type, which wraps ErrorKind
with the spantrace so that errors can be traced further than the call site.
To be honest, I don't like the whole idea of tracing/implementing this library. I'm not sure what issues it solves. It adds a lot of extra code, and I don't think this will go well when we have to implement it in tauri |
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.
lgtm! sorry for the hassle- was a little confused about the backtrace stuff
Intro
This integrates Hydra with Theseus to provide what can be described as the bare minimum requirement for a non-cracked launcher.
Closes #4
Tasks