mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 08:23:47 +01:00
cmount: catch panics in initialization and turn into error messages
This commit is contained in:
parent
975a53c9e3
commit
306a3e0cd7
@ -158,6 +158,11 @@ func mount(VFS *vfs.VFS, mountpoint string, opt *mountlib.Options) (<-chan error
|
||||
// Serve the mount point in the background returning error to errChan
|
||||
errChan := make(chan error, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
errChan <- errors.Errorf("mount failed: %v", r)
|
||||
}
|
||||
}()
|
||||
var err error
|
||||
ok := host.Mount(mountpoint, options)
|
||||
if !ok {
|
||||
|
Loading…
Reference in New Issue
Block a user