-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: nice errors when failing to load plugins
partially fixes #7305
- Loading branch information
Showing
5 changed files
with
82 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// +build !cgo,!noplugin !cgo,!noplugin | ||
// +build linux darwin | ||
|
||
package loader | ||
|
||
import ( | ||
"errors" | ||
|
||
iplugin "github.com/ipfs/go-ipfs/plugin" | ||
) | ||
|
||
func init() { | ||
loadPluginFunc = nocgoLoadPlugin | ||
} | ||
|
||
func nocgoLoadPlugin(fi string) ([]iplugin.Plugin, error) { | ||
return nil, errors.New("not built with cgo support") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// +build noplugin | ||
|
||
package loader | ||
|
||
import ( | ||
"errors" | ||
|
||
iplugin "github.com/ipfs/go-ipfs/plugin" | ||
) | ||
|
||
func init() { | ||
loadPluginFunc = nopluginLoadPlugin | ||
} | ||
|
||
func nopluginLoadPlugin(string) ([]iplugin.Plugin, error) { | ||
return nil, errors.New("not built with plugin support") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters