Skip to content

可以中断then的future 链吗 #12

@nqf

Description

@nqf
ananas::MakeReadyFuture()
	.Then([] {
		throw std::runtime_error("rrrrrrrrrrrrrrrrrrr");
		return std::string{"Hello1"};
	})
	.Then([](ananas::Try<std::string>&& str) {
		try {
			std::string a = str;
			std::cout << a << std::endl;
			return 100;
		} catch (const std::runtime_error&) {
			std::cout << "xxxxxx" << std::endl;
                           // 希望发生异常以后 退出 这个回调链
			return 888;
		}
	})
	.Then([](int nn) {
		std::cout << nn << std::endl;
	});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions