Error formatting
This commit is contained in:
parent
e0d08e758a
commit
167028a530
2 changed files with 20 additions and 2 deletions
|
|
@ -1,25 +1,41 @@
|
|||
use crate::store::Column;
|
||||
use thiserror::Error;
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Error)]
|
||||
pub enum Error {
|
||||
#[error("Decoding Error: {0} {1}")]
|
||||
DecodeError(DecodeErrorKind, bincode::error::DecodeError),
|
||||
#[error("Encoding Error: {0}")]
|
||||
EncodeError(bincode::error::EncodeError),
|
||||
#[error("Attempt to index non-indexed column {0}")]
|
||||
AttemptToIndexNonIndexableColumn(Column),
|
||||
#[error("Index Corruption: Index is storing eof file position for column {0}")]
|
||||
IndexIsStoringEofFilePosition(Column),
|
||||
#[error("Column {0} is already indexed")]
|
||||
ColumnAlreadyIndexed(Column),
|
||||
#[error("File-System Error: {0}")]
|
||||
IoError(std::io::Error),
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Error)]
|
||||
pub enum DecodeErrorKind {
|
||||
#[error("StoreHeaderNumberOfColumns")]
|
||||
StoreHeaderNumberOfColumns,
|
||||
#[error("StoreHeaderDeletedCount")]
|
||||
StoreHeaderDeletedCount,
|
||||
#[error("StoreHeaderTotalCount")]
|
||||
StoreHeaderTotalCount,
|
||||
#[error("StoreHeaderPrimaryColumn")]
|
||||
StoreHeaderPrimaryColumn,
|
||||
#[error("StoreHeaderIndexedColumns")]
|
||||
StoreHeaderIndexedColumns,
|
||||
#[error("EntryData")]
|
||||
EntryData,
|
||||
#[error("EntryIsDeleted")]
|
||||
EntryIsDeleted,
|
||||
#[error("EntryHeaderWithDataSizes")]
|
||||
EntryHeaderWithDataSizes,
|
||||
#[error("CorruptedData")]
|
||||
CorruptedData,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue