Skip to content

Commit 85ef38b

Browse files
committed
Check successful load of the archive
1 parent ca30713 commit 85ef38b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

examples/arioso/arioso.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,11 @@ int main( int argc, char** argv )
268268

269269
// Open existing library or create a new one. In the last case, the library will be empty.
270270
ario archive;
271-
archive.load( opts.archive_name );
271+
const auto result = archive.load( opts.archive_name );
272+
if ( !result.ok() ) {
273+
std::cerr << "Error loading archive: " << result.what() << std::endl;
274+
return 1;
275+
}
272276

273277
// Extract members from the archive
274278
int retVal = extract_members( opts, archive );

0 commit comments

Comments
 (0)