mirror of
https://github.com/rclone/rclone.git
synced 2024-11-26 02:14:42 +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
|
// Serve the mount point in the background returning error to errChan
|
||||||
errChan := make(chan error, 1)
|
errChan := make(chan error, 1)
|
||||||
go func() {
|
go func() {
|
||||||
|
defer func() {
|
||||||
|
if r := recover(); r != nil {
|
||||||
|
errChan <- errors.Errorf("mount failed: %v", r)
|
||||||
|
}
|
||||||
|
}()
|
||||||
var err error
|
var err error
|
||||||
ok := host.Mount(mountpoint, options)
|
ok := host.Mount(mountpoint, options)
|
||||||
if !ok {
|
if !ok {
|
||||||
|
Loading…
Reference in New Issue
Block a user