implementation of chained exceptions

with test cases but without stacktrace
minor