Skip to content

Commit fcaa317

Browse files
committed
Better handle of errors
1 parent 2b05c7d commit fcaa317

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

killbrowser.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@ func killBrowserHandler(c *gin.Context) {
2222
log.Println(command)
2323

2424
if err != nil {
25-
c.JSON(http.StatusInternalServerError, err)
25+
c.JSON(http.StatusInternalServerError, err.Error())
2626
}
2727

2828
if data.Action == "kill" || data.Action == "restart" {
2929
// _, err := killBrowser(data.Process)
3030
// if err != nil {
31-
// c.JSON(http.StatusInternalServerError, err)
31+
// c.JSON(http.StatusInternalServerError, err.Error())
3232
// }
3333
}
3434

3535
if data.Action == "restart" {
3636
_, err := startBrowser(command, data.URL)
3737
if err != nil {
38-
c.JSON(http.StatusInternalServerError, err)
38+
c.JSON(http.StatusInternalServerError, err.Error())
3939
}
4040
}
4141

0 commit comments

Comments
 (0)