Better error message instead of "No entries in corpus"
This commit is contained in:
parent
c6875b8cf6
commit
34b4a6ac1d
@ -300,7 +300,7 @@ where
|
||||
/// Gets the next entry at random
|
||||
fn next(&mut self, state: &mut Self::State) -> Result<CorpusId, Error> {
|
||||
if state.corpus().count() == 0 {
|
||||
Err(Error::empty("No entries in corpus".to_owned()))
|
||||
Err(Error::empty("No entries in corpus. This often implies the target is not properly instrumented.".to_owned()))
|
||||
} else {
|
||||
let id = random_corpus_id!(state.corpus(), state.rand_mut());
|
||||
self.set_current_scheduled(state, Some(id))?;
|
||||
|
@ -259,7 +259,7 @@ where
|
||||
|
||||
fn next(&mut self, state: &mut Self::State) -> Result<CorpusId, Error> {
|
||||
if state.corpus().count() == 0 {
|
||||
Err(Error::empty(String::from("No entries in corpus")))
|
||||
Err(Error::empty(String::from("No entries in corpus. This often implies the target is not properly instrumented.")))
|
||||
} else {
|
||||
let id = match state.corpus().current() {
|
||||
Some(cur) => {
|
||||
|
@ -158,7 +158,7 @@ where
|
||||
#[allow(clippy::cast_precision_loss)]
|
||||
fn next(&mut self, state: &mut Self::State) -> Result<CorpusId, Error> {
|
||||
if state.corpus().count() == 0 {
|
||||
Err(Error::empty(String::from("No entries in corpus")))
|
||||
Err(Error::empty(String::from("No entries in corpus. This often implies the target is not properly instrumented.")))
|
||||
} else {
|
||||
let rand_prob: f64 = (state.rand_mut().below(100) as f64) / 100.0;
|
||||
let meta = state.metadata_map().get::<ProbabilityMetadata>().unwrap();
|
||||
|
@ -44,7 +44,7 @@ where
|
||||
/// Gets the next entry in the queue
|
||||
fn next(&mut self, state: &mut Self::State) -> Result<CorpusId, Error> {
|
||||
if state.corpus().count() == 0 {
|
||||
Err(Error::empty("No entries in corpus".to_owned()))
|
||||
Err(Error::empty("No entries in corpus. This often implies the target is not properly instrumented.".to_owned()))
|
||||
} else {
|
||||
let id = state
|
||||
.corpus()
|
||||
|
@ -119,7 +119,7 @@ where
|
||||
/// Gets the next entry in the queue
|
||||
fn next(&mut self, state: &mut Self::State) -> Result<CorpusId, Error> {
|
||||
if state.corpus().count() == 0 {
|
||||
return Err(Error::empty("No entries in corpus".to_owned()));
|
||||
return Err(Error::empty("No entries in corpus. This often implies the target is not properly instrumented.".to_owned()));
|
||||
}
|
||||
let id = if let Some(next) = Self::get_next(state) {
|
||||
// next was set
|
||||
|
@ -303,7 +303,7 @@ where
|
||||
fn next(&mut self, state: &mut S) -> Result<CorpusId, Error> {
|
||||
let corpus_counts = state.corpus().count();
|
||||
if corpus_counts == 0 {
|
||||
Err(Error::empty(String::from("No entries in corpus")))
|
||||
Err(Error::empty(String::from("No entries in corpus. This often implies the target is not properly instrumented.")))
|
||||
} else {
|
||||
let s = random_corpus_id!(state.corpus(), state.rand_mut());
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user