sebastiandev / zipper

C++ wrapper around minizip compression library
MIT License
515 stars 123 forks source link

Add basic error_code handeling to unzipper #96

Closed Togtja closed 2 years ago

Togtja commented 3 years ago

Here is an example that should help with #88 I do not remove exeption to keep compatibility with the old API, similar to what can be found in std::filesystem

Lecrapouille commented 3 years ago

@Togtja Is this still in draft ? Do you want to be merged in dev branch ?

Togtja commented 3 years ago

I think there are more places where the an exception is thrown where I have not gotten to. So as is now it will add replacements for exceptions for the Unzipper class, but I have not done this for other places (Zipper class). I might get some time to look at it at some point, but atm I am quite busy, so anybody feel free to continue, doing something similar to the Zipper class.

Neustradamus commented 2 years ago

@Togtja: Have you any progress/news about your PR?

Togtja commented 2 years ago

@Togtja: Have you any progress/news about your PR?

@Neustradamus I haven't worked on it, a mixture of forgetting and time. I might get to look at it, but no promises

Togtja commented 2 years ago

@Lecrapouille @Neustradamus I have added the possibility to use std::error_code for all calls that used to throw when failing. I have not tested this thoroughly. So feel free to write some simple programs that both trigger and not trigger exceptions, using both std::error_code and not.

(Edit: Also forgot that this pull request will be a pain to merge, but once it is tested, I'll get on that)

Lecrapouille commented 2 years ago

Closing since I'm currently working on it. See https://github.com/sebastiandev/zipper/issues/88