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

Exception infomation lost when some Exception occurs #1409

Open
terrason opened this issue Dec 29, 2022 · 3 comments
Open

Exception infomation lost when some Exception occurs #1409

terrason opened this issue Dec 29, 2022 · 3 comments

Comments

@terrason
Copy link

terrason commented Dec 29, 2022

图片
I meet an OOM Exception ,but it's hard to find out . The exception caught outside just says: java.lang.RuntimeException: null

Caused by: java.lang.RuntimeException: null
	at io.minio.S3Base.throwEncapsulatedException(S3Base.java:243)
	at io.minio.MinioClient.putObject(MinioClient.java:1375)
        ....

I personally strongly advise to fix this by changing io.minio.S3Base.java:243 with :

- throw new RuntimeException(exc.getCause());
+ throw new RuntimeException("Failed to put object:" + ext.getMessage(), exc);

The error message may be something better.

throw new RuntimeException(exc.getCause());

@balamurugana
Copy link
Member

Feel free to send a PR

@minus7
Copy link

minus7 commented Feb 20, 2023

Unfortunately, only the ExecutionException passed into throwEncapsulatedException has the stack trace from the call site. The cause in it doesn't have a meaningful stack trace since it comes from a different thread. The only way to keep the stack trace would be to keep ExecutionException, but doing so would make pretty much all checked exception annotations on API functions invalid and make it harder to check the type of exception.

A solution is to just avoid the broken synchronous MinioClient wrapper and use MinioAsyncClient directly; at the cost of having to call .get() yourself and having to check exception causes yourself.

@geniusxc
Copy link

A header you provided implies functionality that is not implemented? anyone met this problem when use the .startAfter() for querying objects

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

4 participants