storj/storage/filestore/error.go

20 lines
388 B
Go
Raw Normal View History

2018-09-28 07:59:27 +01:00
// Copyright (C) 2018 Storj Labs, Inc.
// See LICENSE for copying information.
package filestore
import "os"
// underlyingError returns the underlying error for known os error types.
func underlyingError(err error) error {
switch err := err.(type) {
case *os.PathError:
return err.Err
case *os.LinkError:
return err.Err
case *os.SyscallError:
return err.Err
}
return err
}