Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

thread_pool::fetch_task_or_stop causes the program to pause #73

Open
Eggache666 opened this issue Oct 23, 2020 · 0 comments
Open

thread_pool::fetch_task_or_stop causes the program to pause #73

Eggache666 opened this issue Oct 23, 2020 · 0 comments

Comments

@Eggache666
Copy link

Eggache666 commented Oct 23, 2020

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant