Skip to content

Commit 781d8ae

Browse files
committed
Handle error when looking for path
1 parent 272cd49 commit 781d8ae

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

update.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,13 @@ func updateHandler(c *gin.Context) {
5252
return
5353
}
5454

55+
path, err := osext.Executable()
56+
57+
if err != nil {
58+
c.JSON(500, gin.H{"error": err.Error()})
59+
return
60+
}
61+
5562
c.JSON(200, gin.H{"success": "Please wait a moment while the agent reboots itself"})
56-
path, _ := osext.Executable()
5763
restart(path)
5864
}

0 commit comments

Comments
 (0)