JuliusBrussee/caveman · error

invalid or oversized JSON number

Error message

invalid or oversized JSON number

What it means

Error "invalid or oversized JSON number" thrown in JuliusBrussee/caveman.

Source

Thrown at shared/platform/proposalrun/proposalrun.go:212

		mantissaEnd = i
		var err error
		exponent, err = parseJSONExponent(literal[i+1:])
		if err != nil {
			return "", err
		}
	}
	mantissa := literal[start:mantissaEnd]
	dot := strings.IndexByte(mantissa, '.')
	if dot < 0 {
		dot = len(mantissa)
	}
	integerPart := mantissa[:dot]
	fractionPart := ""
	if dot < len(mantissa) {
		fractionPart = mantissa[dot+1:]
	}
	if len(integerPart) == 0 || len(integerPart)+len(fractionPart) > maxJSONBNumberCoefficient {
		return "", fmt.Errorf("invalid or oversized JSON number")
	}
	for i := 0; i < len(integerPart); i++ {
		if integerPart[i] < '0' || integerPart[i] > '9' {
			return "", fmt.Errorf("invalid JSON number")
		}
	}
	for i := 0; i < len(fractionPart); i++ {
		if fractionPart[i] < '0' || fractionPart[i] > '9' {
			return "", fmt.Errorf("invalid JSON number")
		}
	}
	// PostgreSQL numeric retains the input display scale in jsonb output,
	// including trailing fractional zeroes. Validate the raw scale before the
	// canonical reduction below strips those zeroes; otherwise a value such as
	// 1.0000e-16383 would reduce to a representable scale while its original
	// jsonb insert would fail at the 16383-digit numeric limit.
	rawScale := len(fractionPart) - exponent
	if rawScale > maxJSONBNumericFractionDigits {

View on GitHub (pinned to 27d5a3981a)

Solutions

  1. Provide a valid JSON number within size limits.

When it happens

Trigger: Thrown at shared/platform/proposalrun/proposalrun.go:212 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of JuliusBrussee/caveman@27d5a3981a (2026-08-15). Data as JSON: /api/errors/f77563b52a8c29ad. Report an issue: GitHub.