From f9a3f11d30fb60ae7326171ca560692ecf14a4ef Mon Sep 17 00:00:00 2001 From: Lyndon White Date: Sun, 13 Jun 2021 16:23:36 +0100 Subject: [PATCH] More informative error message for noniterators --- src/source_iterable.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/source_iterable.jl b/src/source_iterable.jl index 3dbccdf..e49f1e0 100644 --- a/src/source_iterable.jl +++ b/src/source_iterable.jl @@ -3,7 +3,9 @@ struct EnumerableIterable{T,S} <: Enumerable end function query(source) - IteratorInterfaceExtensions.isiterable(source) || error() + if !IteratorInterfaceExtensions.isiterable(source) + error("$(typeof(source)) does not meet the IteratorInterfaceExtensions.jl API") + end typed_source = IteratorInterfaceExtensions.getiterator(source) T = eltype(typed_source) S = typeof(typed_source)