mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
Merge pull request #521
4cede18
console_handler: catch exception inside the input loop (moneromooo-monero)
This commit is contained in:
commit
cab6f1239e
1 changed files with 37 additions and 32 deletions
|
@ -268,10 +268,11 @@ namespace epee
|
||||||
template<typename t_cmd_handler>
|
template<typename t_cmd_handler>
|
||||||
bool run(const std::string& prompt, const std::string& usage, const t_cmd_handler& cmd_handler, std::function<void(void)> exit_handler)
|
bool run(const std::string& prompt, const std::string& usage, const t_cmd_handler& cmd_handler, std::function<void(void)> exit_handler)
|
||||||
{
|
{
|
||||||
TRY_ENTRY();
|
|
||||||
bool continue_handle = true;
|
bool continue_handle = true;
|
||||||
m_prompt = prompt;
|
m_prompt = prompt;
|
||||||
while(continue_handle)
|
while(continue_handle)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
if (!m_running)
|
if (!m_running)
|
||||||
{
|
{
|
||||||
|
@ -310,10 +311,14 @@ namespace epee
|
||||||
std::cout << usage;
|
std::cout << usage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (const std::exception &ex)
|
||||||
|
{
|
||||||
|
LOG_ERROR("Exception at [console_handler], what=" << ex.what());
|
||||||
|
}
|
||||||
|
}
|
||||||
if (exit_handler)
|
if (exit_handler)
|
||||||
exit_handler();
|
exit_handler();
|
||||||
return true;
|
return true;
|
||||||
CATCH_ENTRY_L0("console_handler", false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in a new issue