feat: better error handling for sys kill signals

This commit is contained in:
Jagadam Dinesh Reddy authored and GitHub committed 2025-07-22 08:25:21 +02:00
1 parent 21ad653b7e
commit 1582b8b2cd
28 files changed
+876 -361

No files matched your search

+5 -2
View File
@@ -15,7 +15,7 @@ var usersRmCmd = &cobra.Command{
Short: "Delete a user by username or id",
Long: `Delete a user by username or id`,
Args: cobra.ExactArgs(1),
Run: python(func(_ *cobra.Command, args []string, d pythonData) {
RunE: python(func(_ *cobra.Command, args []string, d *pythonData) error {
username, id := parseUsernameOrID(args[0])
var err error
@@ -25,7 +25,10 @@ var usersRmCmd = &cobra.Command{
err = d.store.Users.Delete(id)
}
checkErr(err)
if err != nil {
return err
}
fmt.Println("user deleted successfully")
return nil
}, pythonConfig{}),
}