Handle Unkown Tasks and RPC Error way better
This commit is contained in:
parent
7574628a1d
commit
78ab8c9daf
4 changed files with 33 additions and 4 deletions
|
@ -6,6 +6,7 @@ import (
|
|||
"fmt"
|
||||
"time"
|
||||
|
||||
"git.lastassault.de/speatzle/morffix/constants"
|
||||
"github.com/google/uuid"
|
||||
"nhooyr.io/websocket"
|
||||
)
|
||||
|
@ -89,7 +90,7 @@ func (s *server) Call(ctx context.Context, c *websocket.Conn, method string, par
|
|||
|
||||
// remove request from map
|
||||
delete(s.requests, id)
|
||||
return nil, fmt.Errorf("Request timed out")
|
||||
return nil, constants.ErrRPCRequestTimeout
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue