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

Assert extHandle exists? #873

Closed
pramsey opened this issue Apr 19, 2023 · 3 comments
Closed

Assert extHandle exists? #873

pramsey opened this issue Apr 19, 2023 · 3 comments

Comments

@pramsey
Copy link
Member

pramsey commented Apr 19, 2023

if (extHandle == nullptr) {

@dbaston, I just got burned by this, and spent a lot of time trying to figure out what I was doing wrong. The problem was that I failed to initGeos. Would it make more sense to assert this, as it's more likely to be a development-time error than a run-time error?

@dbaston
Copy link
Member

dbaston commented Apr 19, 2023

Agreed, I don't like propagating the null here...it just increases distance between where the error was introduced and where it breaks. (I have also wasted time with this)

An assert would be helpful but not for users of a debug build. I would be fine with removing the check and letting it crash, but maybe that's unpopular.

Could we not make the default context statically initialized and remove the need for initGEOS altogether?

@pramsey
Copy link
Member Author

pramsey commented Apr 26, 2023

Maybe throw an informative exception?

@strk
Copy link
Member

strk commented Apr 28, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants