Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit fcc6442

Browse files
authored
Merge pull request #312 from galasa-dev/ash-error-handling
Enhanced error handling while creating commands
2 parents 3d21c21 + 839747e commit fcc6442

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pkg/cmd/commandCollection.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -424,17 +424,17 @@ func (commands *commandCollectionImpl) addUsersCommands(factory spi.Factory, roo
424424
var usersDeleteCommand spi.GalasaCommand
425425

426426
usersCommand, err = NewUsersCommand(rootCommand)
427-
usersDeleteCommand, err = NewUsersCommand(rootCommand)
428427

429428
if err == nil {
430429
usersGetCommand, err = NewUsersGetCommand(factory, usersCommand, rootCommand)
431-
usersDeleteCommand, err = NewUsersDeleteCommand(factory, usersCommand, rootCommand)
432-
}
433-
434-
if err == nil {
435-
commands.commandMap[usersCommand.Name()] = usersCommand
436-
commands.commandMap[usersGetCommand.Name()] = usersGetCommand
437-
commands.commandMap[usersDeleteCommand.Name()] = usersDeleteCommand
430+
if err == nil {
431+
usersDeleteCommand, err = NewUsersDeleteCommand(factory, usersCommand, rootCommand)
432+
if err == nil {
433+
commands.commandMap[usersCommand.Name()] = usersCommand
434+
commands.commandMap[usersGetCommand.Name()] = usersGetCommand
435+
commands.commandMap[usersDeleteCommand.Name()] = usersDeleteCommand
436+
}
437+
}
438438
}
439439

440440
return err

0 commit comments

Comments
 (0)