Handle Unkown Tasks and RPC Error way better

This commit is contained in:
Samuel Lorch 2024-07-06 15:54:49 +02:00
parent 7574628a1d
commit 78ab8c9daf
4 changed files with 33 additions and 4 deletions

View file

@ -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
}
}