JuliusBrussee/caveman · error

invalid JSON number

Error message

invalid JSON number

What it means

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

Source

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

	}
	return canonicalJSONNumber(exact), nil
}

// normalizeJSONNumber converts one JSON number literal to the shortest plain
// decimal that has exactly the same base-10 value. It deliberately avoids
// floating-point conversion; all arithmetic is over digit counts and strings.
func normalizeJSONNumber(literal string) (string, error) {
	if len(literal) == 0 || len(literal) > maxJSONBNumberLexeme {
		return "", fmt.Errorf("number exceeds the supported JSONB numeric size")
	}
	start := 0
	negative := false
	if literal[0] == '-' {
		negative = true
		start = 1
	}
	if start == len(literal) {
		return "", fmt.Errorf("invalid JSON number")
	}

	mantissaEnd := len(literal)
	exponent := 0
	for i := start; i < len(literal); i++ {
		if literal[i] != 'e' && literal[i] != 'E' {
			continue
		}
		if mantissaEnd != len(literal) {
			return "", fmt.Errorf("invalid JSON number")
		}
		mantissaEnd = i
		var err error
		exponent, err = parseJSONExponent(literal[i+1:])
		if err != nil {
			return "", err
		}
	}

View on GitHub (pinned to 27d5a3981a)

Solutions

  1. Provide a valid JSON number.

When it happens

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

Common situations: See trigger scenarios.

Understand the failure class


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