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

Function InvalidNumberError

pkg/errors/builders.go:78–84  ·  view source on GitHub ↗

InvalidNumberError creates an E1003 error for a malformed numeric literal, such as a number with multiple decimal points (1.2.3) or an invalid exponent format. Parameters: - value: The raw string that could not be parsed as a number - location: Line/column where the literal starts - sql: Full SQL s

(value string, location models.Location, sql string)

Source from the content-addressed store, hash-verified

76// - location: Line/column where the literal starts
77// - sql: Full SQL source used to generate visual context
78func InvalidNumberError(value string, location models.Location, sql string) *Error {
79 return NewError(
80 ErrCodeInvalidNumber,
81 fmt.Sprintf("invalid numeric literal: '%s'", value),
82 location,
83 ).WithContext(sql, len(value)).WithHint("Check the numeric format (e.g., 123, 123.45, 1.23e10)")
84}
85
86// UnexpectedTokenError creates an E2001 error for a token that does not fit the
87// expected grammar at the current parse position. An intelligent "Did you mean?"

Callers 8

readNumberMethod · 0.92
Example_invalidNumberFunction · 0.92
Example_multiLineErrorFunction · 0.92
mainFunction · 0.92
TestInvalidNumberErrorFunction · 0.85
TestAllErrorsHaveContextFunction · 0.85

Calls 3

WithHintMethod · 0.80
NewErrorFunction · 0.70
WithContextMethod · 0.45

Tested by 6

Example_invalidNumberFunction · 0.74
Example_multiLineErrorFunction · 0.74
TestInvalidNumberErrorFunction · 0.68
TestAllErrorsHaveContextFunction · 0.68