diff --git a/src/io/json.cpp b/src/io/json.cpp index 6d62b91..29c75ad 100644 --- a/src/io/json.cpp +++ b/src/io/json.cpp @@ -119,9 +119,12 @@ namespace fc in.get(); return token.str(); default: - std::cerr< variant token_from_stream( T& in ) { - fc::stringstream ss; + std::stringstream ss; + ss.exceptions( std::ifstream::badbit ); bool parsed_unexpected_character = false; bool received_eof = false; try diff --git a/src/io/sstream.cpp b/src/io/sstream.cpp index 1534f08..28a5aac 100644 --- a/src/io/sstream.cpp +++ b/src/io/sstream.cpp @@ -9,11 +9,13 @@ namespace fc { public: impl( fc::string&s ) :ss( s ) - { } + { ss.exceptions( std::stringstream::badbit | std::stringstream::eofbit ); } + impl( const fc::string&s ) :ss( s ) - { } - impl(){} + { ss.exceptions( std::stringstream::badbit | std::stringstream::eofbit ); } + + impl(){ss.exceptions( std::stringstream::badbit | std::stringstream::eofbit ); } std::stringstream ss; };