Skip to content

Commit

Permalink
fix: add recover middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
ZCube committed Nov 9, 2024
1 parent 12cab8e commit 0d6cd3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cmd/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ var localCmd = &cobra.Command{
cc, remote, rderr := conn.ReadFromUDP(b)
if rderr != nil {
sugar.Error("net.ReadFromUDP() error: %s", rderr)
return c.String(http.StatusInternalServerError, rderr.Error())
return c.String(http.StatusBadGateway, rderr.Error())
} else {
sugar.Debugw("Read from socket",
"Bytes", cc,
Expand Down Expand Up @@ -159,7 +159,7 @@ var localCmd = &cobra.Command{
cc, remote, rderr := conn.ReadFromUDP(b)
if rderr != nil {
sugar.Error("net.ReadFromUDP() error: %s", rderr)
return c.String(http.StatusInternalServerError, rderr.Error())
return c.String(http.StatusBadGateway, rderr.Error())
} else {
sugar.Debugw("Read from socket",
"Bytes", cc,
Expand Down
4 changes: 2 additions & 2 deletions cmd/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ var remoteCmd = &cobra.Command{
cc, remote, rderr := conn.ReadFromUDP(b)
if rderr != nil {
sugar.Error("net.ReadFromUDP() error: %s", rderr)
return c.String(http.StatusInternalServerError, rderr.Error())
return c.String(http.StatusBadGateway, rderr.Error())
} else {
sugar.Debugw("Read from socket",
"Bytes", cc,
Expand Down Expand Up @@ -158,7 +158,7 @@ var remoteCmd = &cobra.Command{
cc, remote, rderr := conn.ReadFromUDP(b)
if rderr != nil {
sugar.Error("net.ReadFromUDP() error: %s", rderr)
return c.String(http.StatusInternalServerError, rderr.Error())
return c.String(http.StatusBadGateway, rderr.Error())
} else {
sugar.Debugw("Read from socket",
"Bytes", cc,
Expand Down

0 comments on commit 0d6cd3b

Please sign in to comment.