MCPcopy Index your code
hub / github.com/XTLS/REALITY / quicError

Function quicError

quic.go:359–374  ·  view source on GitHub ↗

quicError ensures err is an AlertError. If err is not already, quicError wraps it with alertInternalError.

(err error)

Source from the content-addressed store, hash-verified

357// quicError ensures err is an AlertError.
358// If err is not already, quicError wraps it with alertInternalError.
359func quicError(err error) error {
360 if err == nil {
361 return nil
362 }
363 var ae AlertError
364 if errors.As(err, &ae) {
365 return err
366 }
367 var a alert
368 if !errors.As(err, &a) {
369 a = alertInternalError
370 }
371 // Return an error wrapping the original error and an AlertError.
372 // Truncate the text of the alert to 0 characters.
373 return fmt.Errorf("%w%.0w", err, AlertError(a))
374}
375
376func (c *Conn) quicReadHandshakeBytes(n int) error {
377 for c.hand.Len() < n {

Callers 4

StartMethod · 0.85
HandleDataMethod · 0.85
SendSessionTicketMethod · 0.85
StoreSessionMethod · 0.85

Calls 1

AlertErrorTypeAlias · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…