-
Notifications
You must be signed in to change notification settings - Fork 23
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
fix(error): Bubble error up to main when connecting to Redis fails #130
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.
What about the redis storage sync version? If the connection cannot be established, the error is panicked. That is what we wanted to avoid, right?
Yeah, I mostly cared about the server binary, which leverages the async version. But yeah, I should totally do the sync version as well… otherwise this is weird. |
Both in sync redis as well as the cached version
a12935f
to
ba5134d
Compare
// this panic!s And I really don't see how to bubble the redis error back up: | ||
// r2d2 consumes it | ||
// RedisError are not publicly constructable | ||
// So using String as error type… sad |
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.
See #131
.unwrap(); | ||
) -> Result<Self, RedisError> { | ||
let info = ConnectionInfo::from_str(redis_url)?; | ||
let redis_conn_manager = ConnectionManager::new(redis::Client::open(info).unwrap()).await?; |
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.
nitpick: maybe expect
instead of unwrap
for consistency?
No magic here…
Fixes #100