Non-informative messages if the used index is damaged (libc++abi: terminating due to uncaught exception of type std::length_error: vector)
When using Fulgor in large-scale projects and eg copy / download of an index fails from any reason, Fulgor prints a message that's difficult to trace down to the original issue, e.g.,
libc++abi: terminating due to uncaught exception of type std::length_error: vector
It would be extremely helpful if it could print something like "Error: Index corrupted" or "Error: Index loading failed" or something similar.
Hi @karel-brinda,
Thanks for the suggestion! Actually @jermp --- the more I think about it (and given how helpful it has been in my other work in different aspects), it would be incredibly useful to have some sort of signature/checksum for the index. That is, we could compute the signature of the valid index upon the termination of construction, and store this value in the index itself. It would then be possible to have e.g. a verify command that ensures that someone has the index they believe they have (and that it is not corrupted).
Thanks Karel and Rob for your thoughts. Yes, I agree and will add something soon! Also ping: @Alessio-Campa.
Hi everybody,
I added a serialization number to the Fulgor index (this feature is currently in a branch of the codebase that will be merged in main soonish). I'll add a check_version subtool to explicitly check this, although currently any time the index is loaded from disk, the check is made.
Here it is https://github.com/jermp/fulgor/commit/f85ff8f5c4cb379f8d6924e4150018c3505f5861.
Will be merged into main then. Closing this for now.