From dc9eaf381cb774ce9ddf57613e99fb7e381da041 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 14 May 2018 01:03:00 +0200 Subject: Clean up error handling --- src/serdi.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/serdi.c') diff --git a/src/serdi.c b/src/serdi.c index 20690c37..70061b68 100644 --- a/src/serdi.c +++ b/src/serdi.c @@ -301,14 +301,12 @@ main(int argc, char** argv) status = serd_reader_start_file(reader, input, bulk_read); } - if (!status) { + if (status ) { + SERDI_ERRORF("failed to start stream: %s\n", serd_strerror(status)); + } else { status = serd_reader_read_document(reader); } - if (status) { - SERDI_ERRORF("read error: %s\n", serd_strerror(status)); - } - serd_reader_end_stream(reader); if (status <= SERD_FAILURE && use_model) { -- cgit v1.2.1