uber / h3

Hexagonal hierarchical geospatial indexing system
https://h3geo.org
Apache License 2.0
4.87k stars 462 forks source link

Pentagon and grid navigation error codes #627

Open ajfriend opened 2 years ago

ajfriend commented 2 years ago

I wanted to make sure we were in agreement around an offline discussion of #619. I think I'll abandon the changes in that PR and just start a new one, once we reach agreement in this issue.

The thinking, as I recall, was to add a few new error codes:

We would also remove E_PENTAGON, and use either E_UNREACHABLE_CELL or E_PENTAGON_DOMAIN in its place.

We would not add E_TOO_FAR, as that would be covered by E_UNREACHABLE_CELL.

We would also not add E_RETRY_WITH_SAFE, as that information will can be given in the specific function documentation.

One alternative

We could potentially split E_UNREACHABLE_CELL into two different errors:

And E_PENTAGON_DOMAIN would remain. My thinking is that it is distinct from E_PENTAGON_DISTORTION. Folks agree?

Or is all this more detail than the user needs?

dfellis commented 2 years ago

I like the proposed solution over the alternative.

isaacbrodsky commented 2 years ago

This is OK with me.

I might suggest E_ASSERTION_FAILURE as the name for E_UNEXPECTED_CODE_PATH.