Expand description
User-facing error message formatting.
Uses typed error matching (PolarsError variants, io::ErrorKind) rather than string parsing to produce actionable, implementation-agnostic messages.
Structs§
- Conversion
Failure - Values that would not convert, from a strict CAST or a STRPTIME, as the failed run reported them: Polars counts the failures in the batch it was converting and quotes a few.
- File
Error - An error reading a file, said as every reader error is:
"<path>": <what went wrong>. <what to do>.(file_message). - Http
Gone - An HTTP(S) file a request settled cannot be had.
Enums§
- Error
Kind ForPython - Classification for consumers (e.g. Python binding) that map to native exception types. Keeps error-handling logic in one place instead of duplicating in each binding.
Functions§
- conversion_
failure - The conversion that failed, if that is what
erris. - error_
for_ python - Classify a report and return a kind plus user-facing message. Used by the Python binding to raise FileNotFoundError, PermissionDenied, or RuntimeError without duplicating chain-walk logic.
- file_
message whatwent wrong readingpath, in the one shape reader errors take:"<path>": <what went wrong>. <what to do>.Sentence case, its first line ended with a full stop, the file named once.- held_
by_ another_ program - Whether
erris Windows refusing a file another program holds: a sharing violation (32), as from a spreadsheet app with the workbook open, or a locked region (33). Polars rewraps an open’s error with the path in its text, keeping the OS’s words but not the code, so the text is read too. Off Windows those codes mean something else. - http_
gone errasHttpGonewhen it settles thaturlcannot be had: the file is not there, or no server answered.Nonefor what an open might still get past, such as a refused HEAD or a server error.- http_
message - What an HTTP request for
urlcame to, when it failed: the server’s answer, or that there was none, naming the host either way. - in_file
err, from readingpath, named by it (FileError) unless it already is.- located_
message file_message, with the line and column the problem is at, when it is at one place:"spec.toml":3:7: <what went wrong>.Without a path, the location and the sentence alone.- named_
by_ source messagewithfile, a temporary copy datui made, calledsource: what the user opened. A download or a decompressed CSV is read from a temp path the user never typed, and Polars names the file it was reading.- sentence
whatas a sentence: its first letter capitalized and its first line ended with a full stop. The lines after it are kept as they are.- sql_
error_ message - A SQL error as the query prompt shows it: a failed conversion in datui’s words, anything else as Polars says it.
- starts_
with_ a_ key - Whether
whatstarts with a key, a path or a name rather than a word: its first word followed by:(type: expected …), or holding.,_,=, a digit, a quote or a backtick (tags.nine,"day").sentenceleaves it as written. - store_
message - What an object store said about a file in it: a missing object, refused access, or the store’s own words, each with what to check.
- user_
message_ from_ io - Format an io::Error as a user-facing message by matching on ErrorKind.
- user_
message_ from_ polars - Format a PolarsError as a user-facing message by matching on its variant.
- user_
message_ from_ report - Format a color_eyre Report by downcasting to known error types. Walks the cause chain to find PolarsError or io::Error.