Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[request] using exception for error handling #139

Open
Azhng opened this issue Jun 14, 2022 · 2 comments
Open

[request] using exception for error handling #139

Azhng opened this issue Jun 14, 2022 · 2 comments

Comments

@Azhng
Copy link
Contributor

Azhng commented Jun 14, 2022

Is your feature request related to a problem? Please describe.
Currently, Popsift directly calls exit() function (example) when it encounters failures and directly logs into stderr.
Our application directly links to popsift and this results in our application crashing. This is quite difficult to handle since it would require the application to directly intercept the exit() call.

Describe the solution you'd like
Instead of directly calling exit(), it would be amazing to throw an exception so the application can gracefully catch it.

I'd be happy to send in a patch for this.

@simogasp
Copy link
Member

Thanks, feel free to submit a PR, it is indeed better to have a gracious way to end after an error that can be caught from another project using the library.

Azhng added a commit to Azhng/popsift that referenced this issue Aug 18, 2022
Address alicevision#139

Previously, exit() function was called when popsift encountered errors
(e.g. out of memory). This error handling made graceful error handling
within the application using popsift difficult.
This commit replaces all the exit() call with throwing a runtime error
instead.
Azhng added a commit to Azhng/popsift that referenced this issue Aug 29, 2022
Address alicevision#139

Previously, exit() function was called when popsift encountered errors
(e.g. out of memory). This error handling made graceful error handling
within the application using popsift difficult.
This commit replaces all the exit() call with throwing a runtime error
instead.
Azhng added a commit to Azhng/popsift that referenced this issue Sep 21, 2022
Address alicevision#139

Previously, exit() function was called when popsift encountered errors
(e.g. out of memory). This error handling made graceful error handling
within the application using popsift difficult.
This commit replaces all the exit() call with throwing a runtime error
instead.
@stale
Copy link

stale bot commented Nov 2, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants