You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
446 B
17 lines
446 B
package api
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"codefirst.iut.uca.fr/git/thomas.bellembois/codefirst-dockerrunner-common/v2/errors"
|
|
"codefirst.iut.uca.fr/git/thomas.bellembois/codefirst-dockerrunner-common/v2/messages"
|
|
"nhooyr.io/websocket"
|
|
"nhooyr.io/websocket/wsjson"
|
|
)
|
|
|
|
func sendError(ctx context.Context, wsConnection *websocket.Conn, err errors.AppError) {
|
|
fmt.Println(err)
|
|
wsjson.Write(ctx, wsConnection, messages.WSMessage{Error: &err})
|
|
}
|