zserio icon indicating copy to clipboard operation
zserio copied to clipboard

Improve Java ZserioError exception in ZserioIO runtime module

Open mikir opened this issue 4 years ago • 2 comments

ZserioError does not give any info on nested exceptions when thrown from ZserioIO.

It just prints the message of the top exception. But especially in a remote invocation case this is not always useful.

It was observed that an error in the remoting (mixed up string/byte[]) will get an InvocationTargetException whose message is empty. This did not give any useful information.

It would be nicer to use the following alternatives, at least in the case of a InvocationTargetException which always has a cause:

throw new ZserioError("ZserioIO: " + ex.getCause());

or even better to pass the root cause -- here using guav (could be rewrite by own loop to get the rootcause):

throw new ZserioError("ZserioIO: " + Throwables.getRootCause(ex);

or just pass the nested exception, which will give the stack trace:

throw new ZserioError("ZserioIO: error while reading", ex);

mikir avatar Apr 27 '20 11:04 mikir

resolved in #350

dkBrazz avatar Feb 09 '22 10:02 dkBrazz

Thanks a lot to find out this duplicate! We have probably too many issues. ;-)

mikir avatar Feb 09 '22 11:02 mikir