[][src]Module clipivot::errors

The module for describing recoverable errors in my CSV command-line tools.

Note: All of the error handling in this module is structured from this error handling guide and from the source code of the csv crate in Rust. If you're hoping to implement you're own library or binary in Rust, I highly recommend looking at both (and, especiialy, the guide).

You can characterize all four error types in two general categories: errors configuring the CSV reader and errors parsing individual lines. For errors relating to configuration, my goal is simply to be as specific and clear as possible about the nature of a given error. For errors relating to parsing, however, I also think it's important to display record numbers to help users debug errors they run into. Currently, this refers to the 0-indexed number in which a record appears in a CSV document. So record 5 of a CSV would be the seventh line of a CSV with a header row and the sixth line of a CSV without a header row.

This indexing plan is meant to interact nicely with the xsv slice subcommand in the xsv toolkit. So if you run into an error, you can type:

$ xsv slice YOUR_FILENAME -i <RECORD_NUMBER>

to see the full line that caused you to run into an error.

Enums

CsvCliError

The type of CSV error

Type Definitions

CsvCliResult

An alias for CsvCliError