diff --git a/alib2str/src/registry/StringReaderRegistry.cpp b/alib2str/src/registry/StringReaderRegistry.cpp index 710f131a52e6c18f125bdcd28776b18b820f7386..59464245964f4f94e292b7ec008fd5a66c2a44f1 100644 --- a/alib2str/src/registry/StringReaderRegistry.cpp +++ b/alib2str/src/registry/StringReaderRegistry.cpp @@ -16,10 +16,15 @@ std::shared_ptr < abstraction::OperationAbstraction > StringReaderRegistry::getA return entry.first ( ss ); }; - const auto & entries = getEntries ( ) [ group ]; + const auto & entryIterator = getEntries ( ).find ( group ); + if ( entryIterator == getEntries ( ).end ( ) ) + throw exception::CommonException ( "Entry " + group + " not available." ); + + const auto & entries = entryIterator->second; + typename ext::deque < std::pair < std::function < bool ( std::istream & ) >, std::unique_ptr < Entry > > >::const_iterator callback = find_if ( entries.begin ( ), entries.end ( ), lambda ); if ( callback == entries.end ( ) ) - throw exception::CommonException ( "Entry " + group + " not available." ); + throw exception::CommonException ( "No callback handling input found." ); return callback->second->getAbstraction ( ); }