Skip to content
Snippets Groups Projects
Commit e365b82e authored by Jan Trávníček's avatar Jan Trávníček
Browse files

fix error reporting of string parser

parent 9b25048f
No related branches found
No related tags found
No related merge requests found
Pipeline #20113 passed
...@@ -16,10 +16,15 @@ std::shared_ptr < abstraction::OperationAbstraction > StringReaderRegistry::getA ...@@ -16,10 +16,15 @@ std::shared_ptr < abstraction::OperationAbstraction > StringReaderRegistry::getA
return entry.first ( ss ); 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 ); 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 ( ) ) if ( callback == entries.end ( ) )
throw exception::CommonException ( "Entry " + group + " not available." ); throw exception::CommonException ( "No callback handling input found." );
   
return callback->second->getAbstraction ( ); return callback->second->getAbstraction ( );
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment