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

JtsAdapter is swallowing it's exception #39

Open
dadadamarine opened this issue Jul 31, 2019 · 2 comments
Open

JtsAdapter is swallowing it's exception #39

dadadamarine opened this issue Jul 31, 2019 · 2 comments
Assignees

Comments

@dadadamarine
Copy link

dadadamarine commented Jul 31, 2019

private static List<Geometry> flatIntersection(Geometry envelope, List<Geometry> dataGeoms) {
        final List<Geometry> intersectedGeoms = new ArrayList<>(dataGeoms.size());

        Geometry nextIntersected;
        for(Geometry nextGeom : dataGeoms) {
            try {

                // AABB intersection culling
                if(envelope.getEnvelopeInternal().intersects(nextGeom.getEnvelopeInternal())) {

                    nextIntersected = envelope.intersection(nextGeom);
                    if(!nextIntersected.isEmpty()) {
                        nextIntersected.setUserData(nextGeom.getUserData());
                        intersectedGeoms.add(nextIntersected);
                    }
                }

            } catch (TopologyException e) {
                LoggerFactory.getLogger(JtsAdapter.class).error(e.getMessage(), e);
            }
        }

        return intersectedGeoms;
    }

I cannot catch TopologyException because of this , and also cannot handle log about this.
plz throw exception to us Or just printStackTrace so that we can handle Exception, and it's log

@ShibaBandit ShibaBandit self-assigned this Aug 2, 2019
@ShibaBandit
Copy link
Member

I agree some custom handling would be nice here. The exception is logged, what is the reason for printStackTrace over logging it?

@dadadamarine
Copy link
Author

I think that, using slf4j in library codes means forcing programmer to log this error message, even if they dont want that.

but printStackTrace don't. printStackTrace just show error code in programmer's console, but doesn't write logs on logging file or server console. so programmer can choose one between logging this message on file or not

Of courese, I agree with that custom handling or throwing error to programmer is best.
but this way of modification will break backward compatibility also.

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