Skip to content

Add try catch block in progress bar#312

Merged
Grantim merged 3 commits intomasterfrom
Add_try_catch_block_in_progress_bar
Jul 27, 2022
Merged

Add try catch block in progress bar#312
Grantim merged 3 commits intomasterfrom
Add_try_catch_block_in_progress_bar

Conversation

@Grantim
Copy link
Contributor

@Grantim Grantim commented Jul 27, 2022

No description provided.

@Grantim Grantim requested a review from Fedr July 27, 2022 15:03
}
catch ( const std::bad_alloc& badAllocE )
{
onFinish_ = [badAllocE] ()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better [what = badAllocE.what()]

}
catch ( const std::exception& e )
{
onFinish_ = [e] ()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here as well, otherwise you create a copy of exception

}
catch ( const std::bad_alloc& badAllocE )
{
onFinish_ = [msg = badAllocE.what()] ()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

even better to write [msg = std::string(badAllocE.what()]

@Grantim Grantim merged commit 33b5573 into master Jul 27, 2022
@Grantim Grantim deleted the Add_try_catch_block_in_progress_bar branch July 27, 2022 16:45
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

Successfully merging this pull request may close these issues.

2 participants