-
Notifications
You must be signed in to change notification settings - Fork 985
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
Hard link serve panic fix #2210
Conversation
components/utils/src/fs.rs
Outdated
} | ||
} | ||
if let Err(e) = std::fs::hard_link(src, dest) { | ||
console::error(&format!("File System Error, src: {:?}, dst: {:?}", src, dest)); |
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.
No need to import console
, just return an error for both
1848091
to
f95b4f5
Compare
components/utils/src/fs.rs
Outdated
std::fs::hard_link(src, dest)? | ||
if dest.exists() { | ||
std::fs::remove_file(dest) | ||
.with_context(|| format!("Error removing file, dst: {:?}", dest))?; |
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.
dst is not going to be clear to the end error, just put Error removing file: {:?}
components/utils/src/fs.rs
Outdated
.with_context(|| format!("Error removing file, dst: {:?}", dest))?; | ||
} | ||
std::fs::hard_link(src, dest) | ||
.with_context(|| format!("Error linking file, src: {:?}, dst: {:?}", src, dest))?; |
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.
Error linking file -> Error hard linking file
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!
* Fix hard link panic and add better error info to std:fs errors * cargo fmt * Remove erroneously committed config change * Remove console import; Use with context to provide additional error info * improve error wording
* Fix hard link panic and add better error info to std:fs errors * cargo fmt * Remove erroneously committed config change * Remove console import; Use with context to provide additional error info * improve error wording
* Fix hard link panic and add better error info to std:fs errors * cargo fmt * Remove erroneously committed config change * Remove console import; Use with context to provide additional error info * improve error wording
IMPORTANT: Please do not create a Pull Request adding a new feature without discussing it first.
The place to discuss new features is the forum: https://zola.discourse.group/
If you want to add a new feature, please open a thread there first in the feature requests section.
Sanity check:
Code changes
(Delete or ignore this section for documentation changes)
next
branch?If the change is a new feature or adding to/changing an existing one:
Fixes #2081