MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / IsStructuredError

Function IsStructuredError

pkg/errors/formatter.go:331–334  ·  view source on GitHub ↗

IsStructuredError reports whether err is a GoSQLX *Error value. Use this to distinguish GoSQLX structured errors from generic Go errors before calling functions that require *Error (e.g., ExtractLocation). Example: if errors.IsStructuredError(err) { loc, _ := errors.ExtractLocation(err)

(err error)

Source from the content-addressed store, hash-verified

329// // use loc for IDE diagnostics
330// }
331func IsStructuredError(err error) bool {
332 _, ok := err.(*Error)
333 return ok
334}
335
336// ExtractLocation extracts the line/column location from a GoSQLX *Error.
337// This is the preferred way to obtain location data for IDE integrations such as

Callers 1

TestIsStructuredErrorFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestIsStructuredErrorFunction · 0.68