Closed FuryonX closed 3 weeks ago
Hi @FuryonX!
I've been using the error handling introduced upstream in H3 since v4.0. That means whenever I call a C-function from my extension that returns H3Error
, that error is thrown as a Postgres error as well.
In case you wish to swallow the above error, and return -1
instead, you can use BEGIN
/EXCEPTION
like so:
BEGIN
select h3_grid_distance('8a2ab4a00a2ffff','8a02cac36cdffff');
EXCEPTION WHEN external_routine_exception THEN
RETURN -1;
END;
I'm trying to find the distance between two h3indexes. For h3indexes that are near each other, the results are correct. For h3indexes that are far enough apart that they aren't comparable, it is supposed to return a negative number. When i test this statement:
The query fails with this error:
I've tested to make sure both h3indexes are valid. This worked properly on h3-pg 3.7.1 using the h3_distance function, however on 4.1.3 its now failing for me.