I use the boost graph library to work with graphs. I use boost :: serialization to write my graph to a file.
For testing purposes, I changed the integrity of the file. Now my program just crashed all the time. I was wondering if there is a way to prevent the crash (boost :: serialization does not throw exceptions).
And in the general case, for any type of file, without exception, created during parsing, where everything should be correct, is there a way?
Maybe the only solution is to write special serialization / de-serialization functions with exception handling?
Thanks!
Edit: there is a boost :: archive :: archive_exception file when all data is damaged or the file is missing. But if only a certain part of the file changes, it will fail ...
Edit2: I have to catch the input_stream_error exception, but I do not.
source share