Catch exception to_dict