forked from mirrors/kingfisher
Improved error message when self-update cannot find the current binary
This commit is contained in:
parent
def8789c31
commit
23102f4b59
2 changed files with 26 additions and 10 deletions
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## [Unreleased]
|
||||
- Improved error message when self-update cannot find the current binary.
|
||||
|
||||
## [1.47.0]
|
||||
- MongoDB validator now validates `mongodb+srv://` URIs with a fast timeout instead of skipping them
|
||||
- Improved rules: github oauth2, diffbot, mailchimp, aws
|
||||
|
|
|
|||
|
|
@ -129,16 +129,29 @@ pub fn check_for_update(global_args: &GlobalArgs, base_url: Option<&str>) -> Opt
|
|||
.apply_to(&format!("Updated to version {}", status.version()))
|
||||
),
|
||||
Err(e) => match e {
|
||||
UpdError::Io(ref io_err) if io_err.kind() == ErrorKind::PermissionDenied => {
|
||||
warn!(
|
||||
"{}",
|
||||
styles.style_finding_active_heading.apply_to(
|
||||
"Cannot replace the current binary - permission denied.\n\
|
||||
If you installed via a package manager, run its upgrade command.\n\
|
||||
Otherwise reinstall to a user-writable directory or re-run with sudo."
|
||||
)
|
||||
);
|
||||
}
|
||||
UpdError::Io(ref io_err) => match io_err.kind() {
|
||||
ErrorKind::PermissionDenied => {
|
||||
warn!(
|
||||
"{}",
|
||||
styles.style_finding_active_heading.apply_to(
|
||||
"Cannot replace the current binary - permission denied.\n\
|
||||
If you installed via a package manager, run its upgrade command.\n\
|
||||
Otherwise reinstall to a user-writable directory or re-run with sudo."
|
||||
)
|
||||
);
|
||||
}
|
||||
ErrorKind::NotFound => {
|
||||
warn!(
|
||||
"{}",
|
||||
styles.style_finding_active_heading.apply_to(
|
||||
"Cannot replace the current binary - file not found.\n\
|
||||
If you installed via a package manager, run its upgrade command.\n\
|
||||
Otherwise reinstall to a user-writable directory."
|
||||
)
|
||||
);
|
||||
}
|
||||
_ => error!("Failed to update: {e}"),
|
||||
},
|
||||
_ => error!("Failed to update: {e}"),
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue