qax-os/excelize · error

invalid row number %d

Error message

invalid row number %d

What it means

Error from newInvalidRowNumberError, a row-validation helper used by row height/style/insert and cell-name joining APIs when a row number is zero, negative, or above the maximum; at fault is the row index passed to the calling API.

Source

Thrown at errors.go:309

	return fmt.Errorf("invalid link type %q", linkType)
}

// newInvalidNameError defined the error message on receiving the invalid
// defined name or table name.
func newInvalidNameError(name string) error {
	return fmt.Errorf("invalid name %q, the name should be starts with a letter or underscore, can not include a space or character, and can not conflict with an existing name in the workbook", name)
}

// newInvalidOptionalValue defined the error message on receiving the invalid
// optional value.
func newInvalidOptionalValue(name, value string, values []string) error {
	return fmt.Errorf("invalid %s value %q, acceptable value should be one of %s", name, value, strings.Join(values, ", "))
}

// newInvalidRowNumberError defined the error message on receiving the invalid
// row number.
func newInvalidRowNumberError(row int) error {
	return fmt.Errorf("invalid row number %d", row)
}

// newInvalidSharedStringIndex defined the error message on receive an invalid
// shared string index.
func newInvalidSharedStringIndex(idx int) error {
	return fmt.Errorf("invalid shared string index %d", idx)
}

// newInvalidSlicerNameError defined the error message on receiving the invalid
// slicer name.
func newInvalidSlicerNameError(name string) error {
	return fmt.Errorf("invalid slicer name %q", name)
}

// newInvalidStyleID defined the error message on receiving the invalid style
// ID.
func newInvalidStyleID(styleID int) error {
	return fmt.Errorf("invalid style ID %d", styleID)

View on GitHub (pinned to f2483381fb)

Solutions

  1. Pass rows within 1..MaxRowCount
  2. Clamp computed row indices before calling row APIs
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at errors.go:309 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of qax-os/excelize@f2483381fb (2026-09-02). Data as JSON: /api/errors/4c580e2794e1ca68. Report an issue: GitHub.