Liking cljdoc? Tell your friends :D

beme.alpha.errors

Consistent error infrastructure for the beme reader/tokenizer. All error throw sites should use beme-error to ensure uniform location tracking and message formatting.

Consistent error infrastructure for the beme reader/tokenizer.
All error throw sites should use `beme-error` to ensure uniform
location tracking and message formatting.
raw docstring

beme-errorclj/s

(beme-error msg)
(beme-error msg {:keys [line col cause source] :as data})

Throw a beme reader/tokenizer error with consistent structure. data may contain :line, :col (1-indexed), :cause, and :source. :source-context is added to ex-data when both :source and :line are present. :source and :cause are always excluded from ex-data.

Throw a beme reader/tokenizer error with consistent structure.
data may contain :line, :col (1-indexed), :cause, and :source.
:source-context is added to ex-data when both :source and :line
are present. :source and :cause are always excluded from ex-data.
sourceraw docstring

format-errorclj/s

(format-error e)
(format-error e source)

Format an exception for display, optionally with source context. Shows multi-line context with line numbers, span underlines, and secondary locations when available in ex-data.

This function bridges two line models: :line/:col in ex-data come from the scanner (where \r occupies a column), while the display line comes from source-context (which uses str/split-lines, stripping \r from CRLF pairs). For CRLF sources the display line may be shorter than the scanner col implies — span-underline clamps to avoid overrunning the display. Returns a string suitable for printing.

Format an exception for display, optionally with source context.
Shows multi-line context with line numbers, span underlines, and
secondary locations when available in ex-data.

This function bridges two line models: :line/:col in ex-data come from
the scanner (where \r occupies a column), while the display line comes
from source-context (which uses str/split-lines, stripping \r from CRLF
pairs). For CRLF sources the display line may be shorter than the scanner
col implies — span-underline clamps to avoid overrunning the display.
Returns a string suitable for printing.
sourceraw docstring

source-contextclj/s

(source-context source line)

Extract the source line at the given 1-indexed line number for display. Uses str/split-lines which splits on \n and \r\n (stripping \r from CRLF pairs). This is the display line model — it may differ from the scanner line model (beme.alpha.scan.source/line-col->offset) which treats \r as a regular character. The difference only matters for CRLF sources. Returns nil if source is nil/blank, line is nil, or line is out of range.

Extract the source line at the given 1-indexed line number for display.
Uses str/split-lines which splits on \n and \r\n (stripping \r from
CRLF pairs). This is the *display* line model — it may differ from the
scanner line model (beme.alpha.scan.source/line-col->offset) which treats
\r as a regular character. The difference only matters for CRLF sources.
Returns nil if source is nil/blank, line is nil, or line is out of range.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close