MCPcopy Index your code
hub / github.com/cockroachdb/errors / init

Function init

errbase/adapters.go:187–214  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

185}
186
187func init() {
188 baseErr := goErr.New("")
189 RegisterLeafDecoder(GetTypeKey(baseErr), decodeErrorString)
190
191 RegisterLeafDecoder(GetTypeKey(context.DeadlineExceeded), decodeDeadlineExceeded)
192
193 pkgE := pkgErr.New("")
194 RegisterLeafEncoder(GetTypeKey(pkgE), encodePkgFundamental)
195
196 RegisterWrapperDecoder(GetTypeKey(pkgErr.WithMessage(baseErr, "")), decodeWithMessage)
197
198 ws := pkgErr.WithStack(baseErr)
199 RegisterWrapperEncoder(GetTypeKey(ws), encodePkgWithStack)
200
201 registerOsPathErrorMigration() // Needed for Go 1.16.
202 pKey := GetTypeKey(&os.PathError{})
203 RegisterWrapperEncoder(pKey, encodePathError)
204 RegisterWrapperDecoder(pKey, decodePathError)
205
206 pKey = GetTypeKey(&os.LinkError{})
207 RegisterWrapperEncoder(pKey, encodeLinkError)
208 RegisterWrapperDecoder(pKey, decodeLinkError)
209 pKey = GetTypeKey(&os.SyscallError{})
210 RegisterWrapperEncoder(pKey, encodeSyscallError)
211 RegisterWrapperDecoder(pKey, decodeSyscallError)
212
213 RegisterLeafEncoder(GetTypeKey(&OpaqueErrno{}), encodeOpaqueErrno)
214}

Callers

nothing calls this directly

Calls 6

RegisterLeafDecoderFunction · 0.70
GetTypeKeyFunction · 0.70
RegisterLeafEncoderFunction · 0.70
RegisterWrapperDecoderFunction · 0.70
RegisterWrapperEncoderFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…