MCPcopy
hub / github.com/nats-io/nats.go / normalizeErr

Function normalizeErr

nats.go:2997–3001  ·  view source on GitHub ↗

normalizeErr removes the prefix -ERR, trim spaces and remove the quotes.

(line string)

Source from the content-addressed store, hash-verified

2995
2996// normalizeErr removes the prefix -ERR, trim spaces and remove the quotes.
2997func normalizeErr(line string) string {
2998 s := strings.TrimSpace(strings.TrimPrefix(line, _ERR_OP_))
2999 s = strings.TrimLeft(strings.TrimRight(s, "'"), "'")
3000 return s
3001}
3002
3003// natsProtoErr represents an -ERR protocol message sent by the server.
3004type natsProtoErr struct {

Callers 3

TestNormalizeErrorFunction · 0.85
sendConnectMethod · 0.85
processErrMethod · 0.85

Calls

no outgoing calls

Tested by 1

TestNormalizeErrorFunction · 0.68