-
Notifications
You must be signed in to change notification settings - Fork 18
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: don't panic on missing shorebird.yaml #18
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.
let chat on vc quick.
} | ||
|
||
/// Report that the current active path failed to launch. | ||
/// This will mark the patch as bad and activate the next best patch. | ||
pub fn report_launch_failure() -> Result<(), UpdateError> { | ||
pub fn report_launch_failure() -> anyhow::Result<()> { |
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.
UpdateError was a dream. Probably can die now that we've teched up to anyhow.
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.
Filed #19 – I think we'll want to overhaul our error handling more generally as part of this.
library/src/updater.rs
Outdated
// Send info from app + current slot to server. | ||
let response_result = send_patch_check_request(&config, &state); | ||
match response_result { | ||
Err(err) => { |
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.
In a follow up patch, we should just make the Rust API return these errors, and the c_api responsible to log them when needed.
Description
Fixes shorebirdtech/shorebird#413
Validated by:
shorebird init
shorebird.yaml
shorebird --local-engine-src-path=$HOME/Shorebird/engine/src --local-engine=android_release_arm64 run -- --release
doesn't panic and still launches the app.I also tested the release-patch flow to ensure that didn't break.
with_config
inlibrary/src/config.rs
toanyhow::Result<R>
instead ofR
with_config
to handle the possibility thatwith_config
may return an error by propagating the error, usually tolog_on_error
inlibrary/src/c_api.rs
because the updater can't do much if noshorebird.yaml
is provided.Potential Future Work
anyhow::Error
anyhow::Error::from()
is pretty verbose and I suspect there's a better, more idiomatic way to useanyhow::Error
. Thereport_launch_result_with_no_current_patch
test is especially ugly.Type of Change