-
Notifications
You must be signed in to change notification settings - Fork 559
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
[UX] Friendly error message when mounting fails with non-empty mount path #1908
Changes from 22 commits
e5842dc
35b966a
dcfd0f8
215b053
ad0818c
ac8bc8d
87f1f78
bec9c9e
9a73e03
2192cfa
f87b478
8b4f8b1
8474981
51ab522
0bcddd0
f0defc2
82f210f
c56a411
a0b1eae
c4099f8
5c5023c
f5869c1
8882e03
1491b61
2d17d55
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -60,7 +60,7 @@ def get_mounting_command( | |||||
# Check if mount path contains files | ||||||
if [ "$(ls -A $MOUNT_PATH)" ]; then | ||||||
echo "Mount path $MOUNT_PATH is not empty. Please make sure its empty." | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
(Suggest a fix for common scenarios first; e.g., if people accidentally mount to /tmp, the first fix should be use another path) NOTE: I find it confusing that we allow mounting to a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated the echo message. What kind of potential issues can be arised by allowing to mount on existing directories? |
||||||
exit 1 | ||||||
exit 42 | ||||||
landscapepainter marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
fi | ||||||
fi | ||||||
echo "Mounting $SOURCE_BUCKET to $MOUNT_PATH with $MOUNT_BINARY..." | ||||||
|
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's good to catch
exceptions.MOUNT_PATH_NON_EMPTY_CODE
since that's a common case.What happens if
e.returncode != exceptions.MOUNT_PATH_NON_EMPTY_CODE
. We should perhaps add a|| echo
like mentioned here, so the error is surfaced nicely instead of the entire heredoc.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.
With the current implementation, when
e.returncode != exceptions.MOUNT_PATH_NON_EMPTY_CODE
(manually setting the exit code of the heredoc to be99
andMOUNT_PATH_NON_EMPTY_CODE
to be42
) and attempting to mount to a non-empty directory, it does surface the error message from the heredoc without displaying the entire heredoc :E 05-05 03:11:59 subprocess_utils.py:70] Mount path /tmp is not empty. Please make sure its empty.
Does it still need the
|| echo
implementation inmounting_utils.py
? If so, what error should it be catching? The only error with an exit code in the heredoc frommounting_utils.py
is when the$MOUNT_PATH
is non-empty, and in this case, it is hard coded that it exits with42
and echos a error message as well:E 05-05 03:11:59 subprocess_utils.py:70] Mount path /tmp is not empty. Please make sure its empty.
Or perhaps, I misunderstood what you meant. Would you mind elaborating a bit more if this is the case?