Skip to content

Commit

Permalink
cmd/mountlib: better snap mount error message
Browse files Browse the repository at this point in the history
Mounting will always fail when rclone is installed from the snap package manager.
But the error message generated when trying to mount from a snap install was not
very good. Improve the error message.

Fixes rclone#8208
  • Loading branch information
divinity76 authored Dec 6, 2024
1 parent 2446c49 commit a78bc09
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/mountlib/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,9 @@ func (m *MountPoint) Mount() (mountDaemon *os.Process, err error) {

m.ErrChan, m.UnmountFn, err = m.MountFn(m.VFS, m.MountPoint, &m.MountOpt)
if err != nil {
if len(os.Args) > 0 && strings.HasPrefix(os.Args[0], "/snap/") {
return nil, fmt.Errorf("mounting is not supported when running from snap")
}
return nil, fmt.Errorf("failed to mount FUSE fs: %w", err)
}
m.MountedOn = time.Now()
Expand Down

0 comments on commit a78bc09

Please sign in to comment.