Standard library / crypto/tls

tls.RecordHeaderError.Error()

Formats a TLS record-header error; malformed records and plaintext on a TLS port can cause this class of error. Synthetic example. Expected stdout: 'tls: demo\n'.

Formal Syntax & Structure

go syntaxgo
func (e RecordHeaderError) Error() string

Return Value

string

Result of the operation; handle any returned error before using other results.

Working Example

Example Snippetgo
package main
import (  "crypto/tls"  "fmt")
func main() { fmt.Println(tls.RecordHeaderError{Msg: "demo"}.Error()) }
func must[T any](v T, e error) T {  if e != nil {    panic(e)  }  return v}func check(e error) {  if e != nil {    panic(e)  }}
Go Reference