ExtractLocation extracts the line/column location from a GoSQLX *Error. This is the preferred way to obtain location data for IDE integrations such as LSP diagnostics, since it handles the type assertion safely. Returns the Location and true when err is a *Error; returns a zero Location and false f
(err error)
| 340 | // Returns the Location and true when err is a *Error; returns a zero Location |
| 341 | // and false for all other error types. |
| 342 | func ExtractLocation(err error) (models.Location, bool) { |
| 343 | if structErr, ok := err.(*Error); ok { |
| 344 | return structErr.Location, true |
| 345 | } |
| 346 | return models.Location{}, false |
| 347 | } |
| 348 | |
| 349 | // ExtractErrorCode extracts the ErrorCode from a GoSQLX *Error. |
| 350 | // Unlike GetCode, this function returns a boolean indicating whether the extraction |
no outgoing calls