video-server icon indicating copy to clipboard operation
video-server copied to clipboard

[FEATURE REQUEST] Improve error handling

Open LdDl opened this issue 5 years ago • 1 comments
trafficstars

Is your feature request related to a problem? Please describe. Here is example of code without any client feedback about error:

func wshandler(wsUpgrader *websocket.Upgrader, w http.ResponseWriter, r *http.Request, app *Application) {
	...
	...
	streamIDSTR := r.FormValue("suuid")
	streamID, err := uuid.Parse(streamIDSTR)
	if err != nil {
		log.Printf("Can't parse UUID: '%s' due the error: %s\n", streamIDSTR, err.Error())
		return
	}
	...
	...
}

It's bad practice, because client doesn't even know who (client or server) is wrong in case when there is no video-stream in player without talking to Back-end programmer.

Describe the solution you'd like and provide pseudocode examples if you can Just wrtie some fancy error codes (with text) for most of cases.

Describe alternatives you've considered and provide pseudocode examples if you can nope

Additional context nope

LdDl avatar Oct 05 '20 08:10 LdDl

assigned @morozka Do 50x, 40x for WS (status + response) and HTTP (static HLS) request

LdDl avatar Oct 12 '20 07:10 LdDl