Skip to content

Commit 0c00767

Browse files
committed
update dbc install error on not found
1 parent b51ef3c commit 0c00767

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

cmd/dbc/info_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func (suite *SubcommandTestSuite) TestInfo_DriverNotFound() {
3838
GetModelCustom(baseModel{getDriverRegistry: getTestDriverRegistry, downloadPkg: downloadTestPkg})
3939
out := suite.runCmdErr(m)
4040

41-
suite.validateOutput("\r ", "\nError: driver `non-existent-driver` not found in driver registry index", out)
41+
suite.validateOutput("\r ", "\nError: driver `non-existent-driver` not found in driver registry index; try: `dbc search` to list available drivers", out)
4242
}
4343

4444
func (suite *SubcommandTestSuite) TestInfoPartialRegistryFailure() {

cmd/dbc/install_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func (suite *SubcommandTestSuite) TestInstall() {
3939
func (suite *SubcommandTestSuite) TestInstallDriverNotFound() {
4040
m := InstallCmd{Driver: "foo", Level: suite.configLevel}.
4141
GetModelCustom(baseModel{getDriverRegistry: getTestDriverRegistry, downloadPkg: downloadTestPkg})
42-
suite.validateOutput("\r ", "\nError: could not find driver: driver `foo` not found in driver registry index", suite.runCmdErr(m))
42+
suite.validateOutput("\r ", "\nError: could not find driver: driver `foo` not found in driver registry index; try: `dbc search` to list available drivers", suite.runCmdErr(m))
4343
suite.driverIsNotInstalled("test-driver-1")
4444
}
4545

cmd/dbc/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func findDriver(name string, drivers []dbc.Driver) (dbc.Driver, error) {
7878
})
7979

8080
if idx == -1 {
81-
return dbc.Driver{}, fmt.Errorf("driver `%s` not found in driver registry index", name)
81+
return dbc.Driver{}, fmt.Errorf("driver `%s` not found in driver registry index; try: `dbc search` to list available drivers", name)
8282
}
8383
return drivers[idx], nil
8484
}

0 commit comments

Comments
 (0)