MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / decodeError

Function decodeError

internal/wsrelay/http.go:235–248  ·  view source on GitHub ↗
(payload map[string]any)

Source from the content-addressed store, hash-verified

233}
234
235func decodeError(payload map[string]any) error {
236 if payload == nil {
237 return errors.New("wsrelay: unknown error")
238 }
239 message, _ := payload["error"].(string)
240 status := 0
241 if v, ok := payload["status"].(float64); ok {
242 status = int(v)
243 }
244 if message == "" {
245 message = "wsrelay: upstream error"
246 }
247 return fmt.Errorf("%s (status=%d)", message, status)
248}

Callers 2

NonStreamMethod · 0.85
StreamMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected