#5051·steampipe

Highlighter.Highlight silently ignores the error from h.formatter.Format

Author: kaidaguerreCreated Sep 24, 2026Updated Sep 24, 2026

Highlighter.Highlight's call to h.formatter.Format ignores any error it returns.

Where: pkg/interactive/highlighter.go, Highlighter.Highlight.

What happens today: h.formatter.Format(buffer, h.style, tokens)'s return value is discarded. If formatting fails, Highlight still returns buffer.Bytes(), nil with whatever partial/stale content is in buffer.

What a fix would change for users: Highlight would instead return nil, err on a formatter failure, which propagates up through the interactive REPL's syntax highlighting path. That's a new failure mode for a feature that today degrades silently (worst case: wrong highlighting), so it needs an explicit decision on whether a highlighter failure should ever abort the query the user is typing, versus falling back to unhighlighted output.

What analysis is needed before fixing: whether the REPL's caller has a sensible fallback (e.g. render unhighlighted) instead of surfacing the error to the user, and whether chroma (or whatever formatter is in use) can actually fail in practice here.

Generated with Claude Code

https://claude.ai/code/session_01VGDYEHuq4iigxBKFBhJije