summaryrefslogtreecommitdiffstats
path: root/src/error.rs
diff options
context:
space:
mode:
authorPaul Masurel <paul.masurel@gmail.com>2018-11-30 22:46:59 +0900
committerGitHub <noreply@github.com>2018-11-30 22:46:59 +0900
commit07d87e154bdbe6dc4548ea9aef773846a8b1322e (patch)
tree3d7bb8f6bdbdf36463cc488bca8b242697f86841 /src/error.rs
parent8b0b0133ddba277b8f054e1cde7cd6b101bee095 (diff)
Collector refactoring and multithreaded search (#437)
* Split Collector into an overall Collector and a per-segment SegmentCollector. Precursor to cross-segment parallelism, and as a side benefit cleans up any per-segment fields from being Option<T> to just T. * Attempt to add MultiCollector back * working. Chained collector is broken though * Fix chained collector * Fix test * Make Weight Send+Sync for parallelization purposes * Expose parameters of RangeQuery for external usage * Removed &mut self * fixing tests * Restored TestCollectors * blop * multicollector working * chained collector working * test broken * fixing unit test * blop * blop * Blop * simplifying APi * blop * better syntax * Simplifying top_collector * refactoring * blop * Sync with master * Added multithread search * Collector refactoring * Schema::builder * CR and rustdoc * CR comments * blop * Added an executor * Sorted the segment readers in the searcher * Update searcher.rs * Fixed unit testst * changed the place where we have the sort-segment-by-count heuristic * using crossbeam::channel * inlining * Comments about panics propagating * Added unit test for executor panicking * Readded default * Removed Default impl * Added unit test for executor
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/error.rs b/src/error.rs
index c651ad7..5fe3071 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -15,13 +15,13 @@ use std::sync::PoisonError;
#[derive(Debug, Fail)]
pub enum TantivyError {
/// Path does not exist.
- #[fail(display = "path does not exist: '{:?}'", _0)]
+ #[fail(display = "Path does not exist: '{:?}'", _0)]
PathDoesNotExist(PathBuf),
/// File already exists, this is a problem when we try to write into a new file.
- #[fail(display = "file already exists: '{:?}'", _0)]
+ #[fail(display = "File already exists: '{:?}'", _0)]
FileAlreadyExists(PathBuf),
/// Index already exists in this directory
- #[fail(display = "index already exists")]
+ #[fail(display = "Index already exists")]
IndexAlreadyExists,
/// Failed to acquire file lock
#[fail(
@@ -30,28 +30,29 @@ pub enum TantivyError {
)]
LockFailure(LockType),
/// IO Error.
- #[fail(display = "an IO error occurred: '{}'", _0)]
+ #[fail(display = "An IO error occurred: '{}'", _0)]
IOError(#[cause] IOError),
- /// The data within is corrupted.
- ///
- /// For instance, it contains invalid JSON.
- #[fail(display = "file contains corrupted data: '{:?}'", _0)]
+ /// Data corruption.
+ #[fail(display = "File contains corrupted data: '{:?}'", _0)]
CorruptedFile(PathBuf),
/// A thread holding the locked panicked and poisoned the lock.
- #[fail(display = "a thread holding the locked panicked and poisoned the lock")]
+ #[fail(display = "A thread holding the locked panicked and poisoned the lock")]
Poisoned,
/// Invalid argument was passed by the user.
- #[fail(display = "an invalid argument was passed: '{}'", _0)]
+ #[fail(display = "An invalid argument was passed: '{}'", _0)]
InvalidArgument(String),
/// An Error happened in one of the thread.
- #[fail(display = "an error occurred in a thread: '{}'", _0)]
+ #[fail(display = "An error occurred in a thread: '{}'", _0)]
ErrorInThread(String),
/// An Error appeared related to the schema.
#[fail(display = "Schema error: '{}'", _0)]
SchemaError(String),
/// Tried to access a fastfield reader for a field not configured accordingly.
- #[fail(display = "fast field not available: '{:?}'", _0)]
+ #[fail(display = "Fast field not available: '{:?}'", _0)]
FastFieldError(#[cause] FastFieldNotAvailableError),
+ /// System error. (e.g.: We failed spawning a new thread)
+ #[fail(display = "System error.'{}'", _0)]
+ SystemError(String),
}
impl From<FastFieldNotAvailableError> for TantivyError {