Skip to content

thread_pool::fetch_task_or_stop causes the program to pause #73

@Eggache666

Description

@Eggache666

code:

try
{
	cpp_redis::client client;
	client.connect(ip, 6379, [&](const std::string& host, std::size_t port, cpp_redis::connect_state status) {});
	client.sync_commit();
	client.hgetall(key, [](const cpp_redis::reply& reply){
		throw std::runtime_error("what happend!");
	});
	client.sync_commit();
}
catch(const std::exception& e)
{
	std::cerr << e.what() << '\n';
}

when I throw an exception in the labmda expression of hgetall, it goes to line 70 (in the file thread_pool.cpp).
Continue debugging, programm will pause when excute to line 124 (in the file thread_pool.cpp).

So, how can i get the exception out of the lambda expression?

platform: Windows10, VS2019-16.7.5

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions