Skip to content

Commit 0313e83

Browse files
committed
toon_reader
1 parent e7bac20 commit 0313e83

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

include/jsoncons_ext/toon/toon_reader.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,14 +202,18 @@ class basic_toon_reader
202202
{
203203
std::error_code ec;
204204
read(ec);
205+
if (ec)
206+
{
207+
JSONCONS_THROW(ser_error(ec));
208+
}
205209
}
206210

207211
void read(std::error_code& ec)
208212
{
209213
parse_lines(ec);
210214
if (ec)
211215
{
212-
JSONCONS_THROW(ser_error(ec));
216+
return;
213217
}
214218
}
215219

test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ add_executable(unit_tests
206206
ubjson/src/encode_ubjson_tests.cpp
207207
ubjson/src/ubjson_cursor_tests.cpp
208208
ubjson/src/ubjson_encoder_tests.cpp
209+
toon/src/toon_reader_tests.cpp
209210
toon/src/encode_toon_tests.cpp
210211
corelib/src/testmain.cpp
211212
)

0 commit comments

Comments
 (0)