Handle exceptions in python callbacks as return values (RhBug: 1066321)